Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save an extra $150 Dec 1–7 with code CYBERWEEK - stackable with early bird savings: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Differece of Current minus Previous in bar chart using SetAnalysis

Hi All,

I want to show the difference of the Current Minus Previous day values in the bar chart for the current date.  but i struck with calculating the previous day results.

The expression is:

SUM({<COD={'10070000'},ID={'01'}>} FCCMP)  -  

SUM({<COD={'10070000'},ID={'01'},FEC={"$(=date(max(FEC)-1,'DD/MM/YYYY'))"}>} FCCMP

But this is only working for max date.... i tried with different options but not succeed...it is showing zero values for the rest of the dates.

How can i show the bar chart like this:

5th May should have difference of 5th may and 4th may (05/05/15 - 04/05/15)

6th May  should have difference of 6th may and 5th may (06/05/15 - 05/05/15)

and another condition is: If day is "Monday", then the differece should be Monday minus last saturday(instead of previousday, ie>sunday)

Your help is greatly appreciated.

Regards

Siva

1 Solution

Accepted Solutions
rubenmarin

Hi Siva, would be nice to have a sample but meanwhile you can try this:

SUM({<COD={'10070000'},ID={'01'}>} FCCMP)

- Above(SUM({<COD={'10070000'},ID={'01'}>} FCCMP))


I supposed there is no values for sundays, if there are you can try this:

SUM({<COD={'10070000'},ID={'01'}>} FCCMP)

- Above(SUM({<COD={'10070000'},ID={'01'}>} FCCMP), If(Num(WeekDay(FEC)), 1, 2))


In my country WeekDay(Monday) returns zero, it may vary in your country. So in my expression if it's monday (Num(WeekDay(FEC))=0=False, so it goes two steps back.


View solution in original post

1 Reply
rubenmarin

Hi Siva, would be nice to have a sample but meanwhile you can try this:

SUM({<COD={'10070000'},ID={'01'}>} FCCMP)

- Above(SUM({<COD={'10070000'},ID={'01'}>} FCCMP))


I supposed there is no values for sundays, if there are you can try this:

SUM({<COD={'10070000'},ID={'01'}>} FCCMP)

- Above(SUM({<COD={'10070000'},ID={'01'}>} FCCMP), If(Num(WeekDay(FEC)), 1, 2))


In my country WeekDay(Monday) returns zero, it may vary in your country. So in my expression if it's monday (Num(WeekDay(FEC))=0=False, so it goes two steps back.