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: 
tiger_01
Contributor
Contributor

Combo bar chart with sales and previous month sales

Hi,

I'm trying to make a  combo bar chart with month as dimension, and two measures, sales and sales of previous month (two sub-bar in each bar).

I obtained it using  SUM(SALES) as first measure and ABOVE(SUM(SALES),1) as second measure. 

The problem is that the second measure is wrong, because if I select 2018, at January 2018 I'm not able to see Sales of December 2017,  but I see value '0'.

How can I resolve it?

 

Thanks, David

1 Solution

Accepted Solutions
sunny_talwar

Ignore selection of Year as well

Aggr(Above(Sum({<Month, Year>} SALES), 1), (Month, (NUMERIC)))

View solution in original post

6 Replies
sunny_talwar

When you say Month is a dimension, is just Jan, Feb or does it say Jan-2018, Feb-2018? Essentially, does your Month field a Month only field or MonthYear field?

tiger_01
Contributor
Contributor
Author

I've got date field. so i've made Month dimension with Monthname(date)

sunny_talwar

Try this and see if this works

Aggr(Above(Sum({<Month>} SALES), 1), (Month, (NUMERIC)))
tiger_01
Contributor
Contributor
Author

Thanks, it works in general chart, but if I select in a filter panel Year=2018, Sales of previous month (december 2017) become zero, whereas before of do selection they had a value.

sunny_talwar

Ignore selection of Year as well

Aggr(Above(Sum({<Month, Year>} SALES), 1), (Month, (NUMERIC)))
tiger_01
Contributor
Contributor
Author

Thanks man, you are great!