How to Retrieve Dates for the Last 15 Weeks in Bold BI
In Bold BI, you can easily retrieve dates for the last 15 weeks using specific expressions. This can be particularly useful when you need to analyze data over a specific period of time.
Steps to Retrieve Dates
-
Use the
DATEADD
function to subtract 15 weeks from the current date. The expression should look like this:DATEADD(week,-15,TODAY())
-
Next, use an
IF
statement to compare your date value (DateVal
) with the target date. IfDateVal
is greater than or equal to the target date, returnDateVal
. Otherwise, returnnull
. The expression should look like this:IF([DateVal] >= [Target date], [DateVal], null)
-
Finally, remove the null value from widget filtering. This will ensure that your data only includes the dates for the last 15 weeks.
Note: DATEADD function is supported in Microsoft SQL Server, MySQL, and Oracle data sources in Bold BI.
By following these steps, you can easily retrieve dates for the last 15 weeks in Bold BI. This can be a powerful tool for analyzing your data over a specific period of time.