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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

rolling seven days Set analysis

hi i would like to calculate a value;

Rolling seven days   (today-7 days)

*

sum(Levererat Antal)

i have the following syntax which is incorrect i see;

sum({<Leveransdatum={today()-7}>}[Levererat Antal])

Best,

Brad

1 Solution

Accepted Solutions
thomas_skariah
Creator III
Creator III

Hi,

You can try with the below code.

sum({<date={">=$(=AddMonths(Max(date-6),0))<=$(=Max(date))"}>} Value).

Regards,

Tom


View solution in original post

6 Replies
sushil353
Master II
Master II

Try this:

sum({<Leveransdatum={'$(=Date(today()-7,'MM/DD/YYYY')'}>}[Levererat Antal])

I am assuming that Leveransdatum has date format like MM/DD/YYYY.

HTH

Sushil

Not applicable
Author

Hi  i still have syntax error,

Syntax error.png

sushil353
Master II
Master II

Sorry, there is an error

Try this one:

sum({<Leveransdatum={'$(=Date(today()-7,'MM/DD/YYYY'))'}>}[Levererat Antal])

Not applicable
Author

Hi it is not working unfortunately,

do i need to create a new variable?

i have already a variable that vToday = Today() -7;

can i use this in the expression

=sum({<Leveransdatum={'$(=vToday,'YYYY-MM-DD)'}>}[Levererat Antal])

Date format is also YYYY-MM-DD

Best,

Bradley

thomas_skariah
Creator III
Creator III

Hi,

You can try with the below code.

sum({<date={">=$(=AddMonths(Max(date-6),0))<=$(=Max(date))"}>} Value).

Regards,

Tom


sushil353
Master II
Master II

Try this:

vToday =Date(Today() -7,'YYYY-MM-DD')

Then expression

=sum({<Leveransdatum={'$(vToday)'}>}[Levererat Antal])

or

=sum({<Leveransdatum={"=$(vToday)"}>}[Levererat Antal])

if still it is not working then post the sample application.

HTH

Sushil