5 Replies Latest reply: Jul 1, 2011 12:33 PM by cg-innova

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

Thx & Regards,

• ###### Date problem using Set Analysis

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)

• ###### Date problem using Set Analysis

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

• ###### Date problem using Set Analysis

ops i posted the wrong file

• ###### Date problem using Set Analysis

Great job!

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

• ###### Date problem using Set Analysis

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?