Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Ramya
Contributor III
Contributor III

calculation of the rolling month with app default

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.

1 Solution

Accepted Solutions
TimvB
Creator II
Creator II

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.

View solution in original post

4 Replies
TimvB
Creator II
Creator II

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!

Ramya
Contributor III
Contributor III
Author

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

 

TimvB
Creator II
Creator II

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.

Ramya
Contributor III
Contributor III
Author

It worked

Thankyou so much