# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Action-Packed Learning Awaits! QlikWorld 2023. April 17 - 20 in Las Vegas: REGISTER NOW
cancel
Showing results for
Did you mean:
Not applicable

## 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?

8 Replies

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.

talk is cheap, supply exceeds demand
Not applicable
Author

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

Change your dimension to a calculate dimension with expression

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

talk is cheap, supply exceeds demand
MVP

HI

PFA

Thanks & Regards,
Mayil Vahanan R
Not applicable
Author

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?

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.

talk is cheap, supply exceeds demand
Not applicable
Author

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

Contributor

Hi Gysbert,

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

Many Thanks

Mazda

Community Browser