Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
madhuqliklondon
Creator II
Creator II

Set analysis

I am trying to count orders under £15 pounds and I am using this set analysis but its not taking all the products line values, i think I need to add sum in set analysis ,So can i do that

=Count({<[IO.GBP Amount (ex VAT)]={"<15"}>}DISTINCT [IO.Original Order No_])

Where sum goes??

11 Replies
sunny_talwar

May be this

=Count({<[IO.Original Order No_] = {"=Sum([IO.GBP Amount (ex VAT)]) <15"}>} DISTINCT [IO.Original Order No_])

its_anandrjs
Champion III
Champion III

Small change in sunnys code put Distinct on correct position and check.

=Count( DISTINCT {<[IO.Original Order No_] = {"=Sum([IO.GBP Amount (ex VAT)]) < 15"}>}  [IO.Original Order No_])

Regards

Anand

madhuqliklondon
Creator II
Creator II
Author

Hi Sunny ,

I have total count of orders , I am classifying them into under 15 and over 15, I am using the set analysis you have given , but when I add them (under 15 and over 15 ) they are coming more than total original orders count, why is that?

sunny_talwar

AFAIK DISTINCT works on either side of the set analysis

sunny_talwar

Can you share your app or images?

madhuqliklondon
Creator II
Creator II
Author

set1.png

madhuqliklondon
Creator II
Creator II
Author

I have below expressions ,

count(distinct([IO.Sell-to Customer No_])) ,

Count(DISTINCT([IO.Original Order No_])) ,

Sum([IO.GBP Amount (ex VAT)]) ,

avg(Aggr(Sum([IO.GBP Amount (ex VAT)]),[IO.Original Order No_])) ,

Count( DISTINCT {<[IO.Original Order No_] = {"=Sum([IO.GBP Amount (ex VAT)]) < 15"}>}  [IO.Original Order No_]),

Count( DISTINCT {<[IO.Original Order No_] = {"=Sum([IO.GBP Amount (ex VAT)]) > 15"}>}  [IO.Original Order No_])

sunny_talwar

Which expression is the one which is not working?

madhuqliklondon
Creator II
Creator II
Author

these two expressions

Count( DISTINCT {<[IO.Original Order No_] = {"=Sum([IO.GBP Amount (ex VAT)]) < 15"}>}  [IO.Original Order No_]),

Count( DISTINCT {<[IO.Original Order No_] = {"=Sum([IO.GBP Amount (ex VAT)]) > 15"}>}  [IO.Original Order No_])

not matching to this expression

Count(DISTINCT([IO.Original Order No_]))