Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date problem using Set Analysis

Hi there,

I'm new user of Qlikview and manage to do an analysis using dates and values.

My data strucutre is a table with the following fields : DATE - Name - Account - CASH

I tried to do an analysis based on the date for the cash field, e.g. having a column with cash for a selected date and another one for (selected date - 1).

I've tried to do the following but it doesn't work:

Sum

( {$<DATE=DATE>} CASH) --> for the selected date which works



Sum({1<DATE =$(DATE-1)>} CASH) --> dosn't work. In fact, it gives the total sum of the CASH for all data.

Could you please help me.

Thx & Regards,

1 Solution

Accepted Solutions
Not applicable
Author

maybe, if I understood correctly your question, this should help by providing you the sum of previuos day:

sum({<Date={"$(=date(Date-1))"}>} Cash )

I have attached a little file were I have tested it.

EDIT: I have tested on your file and it works fine

View solution in original post

5 Replies
Not applicable
Author

I believe this is the expression you need:

sum(CASH) + above(sum(CASH),1,1)



Here is how it looks

You can adjust how many days back by changing the second argument of the "above" function. Like this

sum(CASH) + above(sum(CASH),2,1)

Not applicable
Author

maybe, if I understood correctly your question, this should help by providing you the sum of previuos day:

sum({<Date={"$(=date(Date-1))"}>} Cash )

I have attached a little file were I have tested it.

EDIT: I have tested on your file and it works fine

Not applicable
Author

ops i posted the wrong file

Not applicable
Author

Great job!

I tried to figure this out myself, and all the other solutions, but only this one worked.

Not applicable
Author

Sorry, I'm new user QV.

On this instrucción

sum({$ <DATE = {$(#=only(DATE)-1)}>} CASH)

how I can add a condition (for example the state of one registration)?

which would be the syntax?