Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

want to display last 30 days dates based on today() date

i have a scenario

i need to display last 30 days dates based on today() date

please suggest appropriated expression for this

thank you

6 Replies
Anonymous
Not applicable
Author

Hey,

you have to take this Set-Analysis in your expression

{<Date={'>=$(=today()-30)<=$(=today())'}>}

Regards.

ankit777
Specialist
Specialist

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; 

jpenuliar
Partner - Specialist III
Partner - Specialist III

You can Flag in your Calendar all the Dates that are 30 Days from Today()

jagan
Partner - Champion III
Partner - Champion III

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.

vcanale
Partner - Creator II
Partner - Creator II

Hi,
try this:
LOAD

  Last30Days,

  Today() as TodayDate;

LOAD

Date(Today() - 30 + RecNo()) As Last30Days

AutoGenerate 30;

thi_pham
Creator III
Creator III

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.