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: 
Anonymous
Not applicable

Add Up count values

Hi,

i want to add up count values. I try it like this, but it doesn´t work:

Count({<[prodYear] = {"$(=getfieldselections(Year))"},[prodMonth] = {"Nov"}>}products) + Count({<[prodYear] = {"$(=getfieldselections(Year))"},prodMonth = {"Okt"}>}products)

The dimension in this chart is prodMonth.

My target is to add up allways the number of products for the last three month.

In Sep i want the sum of products for Jul, Aug, Sep

In Okt i want the sum of products for  Aug, Sep, Okt

etc.

How can i do it?

regards,

sam

1 Solution

Accepted Solutions
sunny_talwar

My bad, forgot to end the set analysis correctly

RangeSum(Above(Count({<[prodYear] = p(Year)>} products), 0, 3))

View solution in original post

10 Replies
sunny_talwar

May be try like this:

RangeSum(Above(Count({<[prodYear] = p(Year)>} products), 0, 3))

sunny_talwar

or this if your months are sorted in descending order

RangeSum(Below(Count({<[prodYear] = p(Year)>} products), 0, 3))

Anonymous
Not applicable
Author

Thanks. The chart shows no data. There are no expression errors in the editor. Is missing a comma or something? I can´t find the reason.

sunny_talwar

My bad, forgot to end the set analysis correctly

RangeSum(Above(Count({<[prodYear] = p(Year)>} products), 0, 3))

Anonymous
Not applicable
Author

Perfect, now it works, thanks a lot 🙂

The chart shows always numbers like 30,23k and i want to see the normal number like 30230. So i put this expression in a textfield to see the normal number only for "nov" (sum for sep,okt,nov). But this expression shows 0

RangeSum(Above(Count({<[prodYear] = p(Year), prodMonth = {"Nov"}>} products), 0, 3))


What´s wrong and how can the chart show normal numbers?


regards,

sam

sunny_talwar

I guess change your number formatting from here:

Capture.PNG

Anonymous
Not applicable
Author

Yes, very easy. I just looked for it and did not find it, but now, thanks one more time again

sunny_talwar

I am glad we were able to figure it out

Anonymous
Not applicable
Author

Hi,

i check the data and the sum for each month does not match those of the excel table

My target is to add up allways the number of products for the last three month.

In Sep i want the sum of products for Jul, Aug, Sep

In Okt i want the sum of products for  Aug, Sep, Okt

etc.

I use your expression and added "distinct"

RangeSum(Above(Count(Distinct{<[prodYear] = p(Year)>} products), 0, 3))

I create a table, select a month in the chart and check the table of double products. There are double products.

Why? Is "Distinct" wrong in this case or at a wrong position?

regards,

sam