Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

joeybird
Contributor II

Difference bar (By week) - Qlik sense

Hiya

I have a bar chart

this shows Customer_ID totals for each week. 05/01/2015, 12/01/2015  column labelled =  Week_Beginning

I need an expression that will show the difference between the two weeks

Like

count({$< Department = {"Catering"},  Week_Beginning - Date(Week)  >}Customer_ID)

e.g

05/01/2015 total was 30

12/01/2015 total was 35  ...so customer difference bar will show the total difference of 5

please help

1 Solution

Accepted Solutions
brunobertels
Valued Contributor II

Re: Difference bar (By week) - Qlik sense

Hi Joanna

I've faced the same problem few days ago

I was needed to calculate the difference between sales from a week with the week before. It's seems that it is what you are looking for.

below the way you may test It :

count({$< Department = {"Catering"}>}Customer_ID)

-

rangesum(above(count({$< Department = {"Catering"}>}Customer_ID)),1,1))

For my need I was able with this kind of formula to have this :

bar chart :

take Week Or Week_Beginning as dimension and the formula above as mesure.

here the same as a table :

hope this will help you

Regards

Bruno

2 Replies
brunobertels
Valued Contributor II

Re: Difference bar (By week) - Qlik sense

Hi Joanna

I've faced the same problem few days ago

I was needed to calculate the difference between sales from a week with the week before. It's seems that it is what you are looking for.

below the way you may test It :

count({$< Department = {"Catering"}>}Customer_ID)

-

rangesum(above(count({$< Department = {"Catering"}>}Customer_ID)),1,1))

For my need I was able with this kind of formula to have this :

bar chart :

take Week Or Week_Beginning as dimension and the formula above as mesure.

here the same as a table :

hope this will help you

Regards

Bruno

joeybird
Contributor II

Re: Difference bar (By week) - Qlik sense

Hiya

this works great thank you however, the subtraction is showing on the wrong week bar week beginning date, its showing the correct figure, but on the week before

Dimension Week_Beginning

e.g difference of 5 is showing on 05/10/2015, where it should be showing on 12/10/2015

if you can help, please do but not to worry as chart looks ok

Kind Regards

Community Browser