Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get dynamic sum for last 30 days

I am doing a weekly report whereby every Monday, I need to get some metrics (eg, site visit, sales) for last week, and compare it with the figure 2 weeks back. I can solve that by using weekstart(Date)

I also need to do a 30days-to-date tracking, but I can't use monthstart() function because it only works for 1st day of the month. I also can't use accumulation because I dont want to display all 30 days in the dimension.

Any function I could use to sum the data for past 30 days for every monday?

5 Replies
MayilVahanan

HI

Try with AddMonths() function

Ex: AddMonths(Date, - 1)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
jjordaan
Partner - Specialist
Partner - Specialist

Hi Adam,


You can create a days ago counter in your calendar and then as an expression you can do something like

Sum({<DayAgo = {'< 31'}>} Sales).

jyothish8807
Master II
Master II

Hi Adam,

PFA. Addmonths function will be useful.

Regards

KC

Best Regards,
KC
Anonymous
Not applicable
Author

Hi try the below expression

=Sum( If( AddMonths(Today(),-1) ,Sales))