Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Less/greater than with Set analysis?

How to do this in set analysis? I want to display average costs of a group (based on ammount of citizens) where the ammount if citizens is less than or greater than 100.000. As an average line in a barchart.

Wat I've done so far:

=sum( {$ <Organization={"=sum([Ammount citizens])>100000"} >} [Cost A]) + sum( {$ <Organization={"=sum([Ammount citizens])>100000"} >} [Cost B])

/

sum( {$ <Organization={"=sum([Ammount citizens])>100000"} >} [Ammount citizens])

'Organization' and 'Ammount citizens' are the dimensions.

6 Replies
Not applicable
Author

Seems good.

Not applicable
Author

But it isn't working, I don't get the same outcome when calculated without

Qlikview.

Op 18 aug. 2014 21:54 schreef "Ajay Prabhakaran" <qcwebmaster@qlikview.com>:

Qlik Community <http://community.qlik.com/> Less/greater than

with Set analysis?

reply from Ajay Prabhakaran

<http://community.qlik.com/people/AjayVallab?et=watches.email.thread> in *New

to QlikView* - View the full discussion

<http://community.qlik.com/message/590622?et=watches.email.thread#590622>

MK_QSL
MVP
MVP

Try

=(sum( {$ <Organization={"=sum([Ammount citizens])>100000"} >} [Cost A]) + sum( {$ <Organization={"=sum([Ammount citizens])>100000"} >} [Cost B]))

/

sum( {$ <Organization={"=sum([Ammount citizens])>100000"} >} [Ammount citizens])

Not applicable
Author

Possible to attach a sample file?

jagan
Luminary Alumni
Luminary Alumni

Hi Wilfred,

Why you are using Ammount citizens as dimension it seems like a measure, I think your expression is correct, but Ammount citizens dimension seems to be an issue, can you remove and check.  If not working then attach some sample data and expected output.

Regards,

Jagan.

Not applicable
Author

You're right about the dimension 'citizens', this is indeed not a dimesion (but a value). Attached an example of the data (and the calculation in Excel).

OrganizationAmmount citizensCost ACost BCost per citizenCost per citizen
A80.00020000003000000€                62,50Group '< 100.000'€    65,27
D750.000400000002000000€                56,00Group '> 100.000'€    53,70
C44.0009000001240000€                48,64
D120.00040000009000000€              108,33
E85.0002750000950000€                43,53
F300.00095000009500000€                63,33
G25.000850000875000€                69,00
H110.00065400003000000€                86,73

Group '< 100.000' =SUM(C2:D2;C4:D4;C6:D6;C8:D8)/SUM(B2;B4;B6;B8)

Group '> 100.000' =SUM(C3:D3;C5:D5;C7:D7;C9:D9)/SUM(B3;B5;B7;B9)