Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
robertpryde
Contributor
Contributor

Set Analysis

I have tried no less than 50 different set analysis formula and as yet, have no solution.  below is a subset of data as a sample.  I would like to count the distinct number of assets where the sum of the station.starved is greater than the sum of the station.blocked.

The end result should be equal to 4. 

asset.idstation.blockedstation.starved
asset.one759523557
asset.one825018234
asset.one1461511925
asset.one14985267
asset.two2752
asset.two39343
asset.two6441462
asset.two60696904
asset.two68453229
asset.three227522581
asset.three521111168
asset.three54077733
asset.three571510076
asset.three58808513
asset.four232919718
asset.four284415774
asset.four438121037
asset.four107253772
asset.four277843758
asset.five48015499
asset.five92529314
asset.five143118936
asset.five167330824
asset.five194433427

 

Any ideas would be greatly appreciated

Labels (3)
3 Replies
Frank_Hartmann
Master II
Master II

Maybe something like this:

=count(DISTINCT {<station.starved={"=aggr(sum(station.starved),asset.id) > aggr(sum(station.blocked),asset.id)"}>}asset.id)
JGMDataAnalysis
Creator III
Creator III

Another interpretation of the problem ...

=Count({<[asset.id] = {"=Sum([station.starved]) > Sum([station.blocked])"}>} DISTINCT [asset.id])
Brett_Bleess
Former Employee
Former Employee

Robert, did either of the posts resolve your request?  If so, please be sure to come back and use the Accept as Solution button to mark the post(s) that helped.  If you did something different, consider posting that and mark it, and if you are still working on things, leave an update as to where you stand.

The best I have to try to give you some further resources are the following:

https://community.qlik.com/t5/Qlik-Design-Blog/A-Primer-on-Set-Analysis/ba-p/1468344

https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/ChartFunctions/...

If you want to search Design Blog area yourself, use the following link:

https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.