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

How to multiply answers in a chart with count

Hi,

I am trying to build an expression that multiplies the answers from specific customers (that has the value BRF/BF = BRF) with 10. The other customers answers are not multiplied.

This is the expression I use:

=num(count({<[Bernt Öst]={'Ja'},[BRF/BS]={'BRF'} >} ID) * 10 +count({<[BRF/BS]={'BS'},[Bernt Öst]={'1'} >} ID))


What annoyes me is that it sometimes returns the correct value, but sometimes not.

In this example I only get the answers from the BRF customers, not the BS customers.

Maybe I've got the expression wrong?

4 Replies
sunny_talwar

Can you try this:

Num(RangeSum((Count({<[Bernt Öst]={'Ja'},[BRF/BS]={'BRF'} >} ID) * 10), Count({<[BRF/BS]={'BS'},[Bernt Öst]={'1'}>} ID)))

Anonymous
Not applicable
Author

Hi again, ☺

With an extra parentheses in the end the expression was correct – but I still have the same result:

Bernts result should be (13 * 10) + 6 = 136.

(If I change the sequence of the calculation the result will be only 6. ?)

Från: Sunny T

Skickat: den 24 februari 2016 14:27

Till: Anna Galli <anna.galli@aktivbo.se>

Ämne: Re: - How to multiply answers in a chart with count

sunny_talwar

Not sure I understand. What are you currently getting and what do you expect to get?

Anonymous
Not applicable
Author

I’m sorry – I can see that I haven’t explained my question fully.

I want to count the votes for one person, but the respondents that have the word ’BRF’ in the field ”BRF/BS” votes shall be multiplied by 10. If a respondent has ’BS’ in the same field the votes shall not be multiplied, but only counted as one vote.

So in this case (Bernt Österling), where we can se that 13 respondents is ’BRF’ and 6 respondents are ’BS’ the calculation should be (13 * 10) + (6 *1) = 136

But, as you can see, the result I get is 130.

And what makes me so confused is that sometimes I get the correct result, and sometimes not.

Från: Sunny T

Skickat: den 24 februari 2016 18:56

Till: Anna Galli <anna.galli@aktivbo.se>

Ämne: Re: - How to multiply answers in a chart with count