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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
PapaJapa
Contributor II
Contributor II

The sum of sales for 7 days from the date in the table

Hello.

I have simple table with dates and sales (~50 rows with unique dates):

Date | sum(Sales)

I would like to add third column with sales  for the previous 7 days before date in row.

Please help 

M

 

Labels (1)
1 Reply
HugoRomeira_PT
Creator
Creator

Hello,

This can be achieved using the following expression:

RangeSum( Above(total sum(Sales),0,7) )


Remark:

The Above() expression is assuming that you want to have your table sorted by date in Ascending order (oldest date will be the first date on the table).

In case you want to change the sort Descending (Recent dates comes first) you need to replace the Above() by Below() expression.

Hope it helps!

If the issue is solved please mark the answer with Accept as Solution.
If you want to go quickly, go alone. If you want to go far, go together.