Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

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
Contributor III

Re: rolling seven days Set analysis

Hi,

You can try with the below code.

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

Regards,

Tom


6 Replies
sushil353
Honored Contributor II

Re: rolling seven days Set analysis

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

Re: rolling seven days Set analysis

Hi  i still have syntax error,

Syntax error.png

sushil353
Honored Contributor II

Re: rolling seven days Set analysis

Sorry, there is an error

Try this one:

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

Not applicable

Re: rolling seven days Set analysis

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
Contributor III

Re: rolling seven days Set analysis

Hi,

You can try with the below code.

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

Regards,

Tom


sushil353
Honored Contributor II

Re: rolling seven days Set analysis

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

Community Browser