8 Replies Latest reply: Jul 9, 2018 3:13 AM by mazda miata

Any day vs 7 days ago data

Hi all!

I have the following data:

Date and Value.

In table I want to get the Value for any Day, but alsoValue for the 7 days ago:

I use the expression: sum( {\$<Day=,Month =,Date = {"\$(=date(Date-7))"}>}Value ) but it doesn't work correctly.

In Qlickview like this:

For any date i must have 2 Values : Value for date and Value for date-7 ago but idon't know how to solve this problem without load two values in script. Can any help?

• Re: Any day vs 7 days ago data

You can't solve this with set analysis expressions. Those are calculated once for the entire chart, not per row. If you have Values for every day and the dates are ordered like in your example you can use above(sum(Value),7) as the expression to get the sum(Value) of 7 rows above, which in this case is also 7 days ago.

• Re: Any day vs 7 days ago data

Thank you, Gysbert ! It doen't suit mе..

• Re: Any day vs 7 days ago data

Change your dimension to a calculate dimension with expression

=GetFieldSelections( Day) & '-' & GetFieldSelections( Month)

• Re: Any day vs 7 days ago data

HI

PFA

• Re: Any day vs 7 days ago data

Gysbert and Mayil, Thank you! Both of solutions show value when i select day and month.

Can i see value vs previous value for all days in month? I.e. if i select month, no selection day?

• Re: Any day vs 7 days ago data

That's not possibly with set analysis expressions. The set is calculated for the entire chart/table, not per row. You'll have to deal with it in the load script. It's fairly easy. See attached example.

• Re: Any day vs 7 days ago data

O'key, i understood, thank you,Gysbert!

• Re: Any day vs 7 days ago data

Hi Gysbert,

Im using Qlikview personal edition. can i have the script paste here?

Many Thanks

Mazda