Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i have a scenario
i need to display last 30 days dates based on today() date
please suggest appropriated expression for this
thank you
Hey,
you have to take this Set-Analysis in your expression
{<Date={'>=$(=today()-30)<=$(=today())'}>}
Regards.
Use the following script
let varMaxDate=num(Today());
let varMinDate=num(today())-30;
TempCalendar:
LOAD
$(varMinDate) + Iterno()-1 As Num,
Date($(varMinDate) + IterNo() - 1) as TempDate
AutoGenerate 1 While $(varMinDate) + IterNo() -1 <= $(varMaxDate);
MasterCalendar:
Load
TempDate AS OrderDate,
week(TempDate) As Week,
Year(TempDate) As Year,
Month(TempDate) As Month,
Day(TempDate) As Day
Resident TempCalendar
Order By TempDate ASC;
Drop Table TempCalendar;
You can Flag in your Calendar all the Dates that are 30 Days from Today()
Hi,
Try this expression
Sum({<YearDimensionName=, QuarterDimensionName=, MonthDimensionName=, DateDimensionName={'>=$(=today()-29)<=$(=today())'}>} Measure)
Replace YearDimensionName, QuarterDimensionName, MonthDimensionName, DateDimensionName with your actual field names.
Hope this helps you.
Regards,
Jagan.
Hi,
try this:
LOAD
Last30Days,
Today() as TodayDate;
LOAD
Date(Today() - 30 + RecNo()) As Last30Days
AutoGenerate 30;
On chart:
- Measure: an if condition to return 0 or null(0 for date before last 30 days
sum(if(DateField - WeekStart(today(),-4,0) > 0, CalculationField, 0))
- Setting on dimension: limit show value > 0 or Not show null() value.