Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ,
i am new to qlik development.
I want to calculate the rolling months for pivot table in qlik sense.
Here i need to achieve the following condition for the pivot table . whenever the app opens i.e, the default selection
Default rolling month: today's date - 31 days data only in the pivot table
Example: Feb 6 - Jan 6
Feb 7 - Jan 7
If the user deselects the above default selection then the complete data should display for the pivot table.
Here i am attaching the qvf.
Can anyone please help me on this.
Thanks.
Ramya.
You are right, I made a mistake. I forgot to add the -31 days. The correct expression for the flag field is:
If(Floor(DateField) >= (Today()-31), 1, 0) as RollingMonth_Flag
I corrected my original message.
In the script, add an extra field in the mastercalendar that flags the dates that are in the rolling month:
If(Floor(DateField) >= (Today()-31), 1, 0) as RollingMonth_Flag
In the front end, create a filter with the RollingMonth_Flag and select 1. Then, create a bookmark and set the bookmark with RollingMonth_Flag as default. When users open the app, the initial selection will only show the data within the rolling month.
Hope it helps!
Hi
Thanks for the response
the below expression is giving only today , but i need to get the (today -31) days to be selected as default
example :
feb8 (today) to jan8)(today-31) which should be dynamic (need this range to be selected as default)
but your calculation is giving only today date when we select 1 in the flag
You are right, I made a mistake. I forgot to add the -31 days. The correct expression for the flag field is:
If(Floor(DateField) >= (Today()-31), 1, 0) as RollingMonth_Flag
I corrected my original message.
It worked
Thankyou so much