Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Include DISTINCT in set analysis

How do I modify the following to include DISTINCT UID? I tried aggr() and UID=DISTINCT UID but could not come up with a working solution. (UID is the first column)

                                                            

UIDReport CategoryMonthlyChangedRCMonth EGM
1CancelledForecasted0.0348
1RealizedForecasted0.0348
1CancelledForecasted0.0348
1CancelledForecasted0.0348
2CancelledOpportunity2.313
2CancelledOpportunity2.313
2CancelledOpportunity2.313
3CancelledForecasted-0.012
4RealizedForecasted0.0944

sum ({<[~Week Number] ={'1','2','3','4'}, [Report Category]-={'Pre-Pipeline','Identified','Opportunity','Forecasted'}, MonthlyChangedRC={'Pre-Pipeline','Identified','Opportunity','Forecasted'}>} [Month EGM] )

5 Replies
SunilChauhan
Champion II
Champion II

sum ({<[~Week Number] ={'1','2','3','4'}, [Report Category]-={'Pre-Pipeline','Identified','Opportunity','Forecasted'}, MonthlyChangedRC={'Pre-Pipeline','Identified','Opportunity','Forecasted'}>} distinct  [Month EGM] )


hope this helps

Sunil Chauhan
Not applicable
Author

I thought of that except I have thousands of records and some could have the same value for [Month EGM] I really need to group it by UID because that is the true unique identifier

Gysbert_Wassenaar

Can you explain what you're really trying to calculate? It sounds like you've already decided on a solution, but what is the actual problem that your solution should solve? Perhaps there are other solutions that will solve that problem more easily.


talk is cheap, supply exceeds demand
Not applicable
Author

I need to find the sum of [Month EGM] where items have moved into a particular Report Category. The Report Category column has the original Report Category and the MonthlyChangedRC has the new Report Category. However, I am looking across 5 weeks of data so there are some items that are being counted multiple times because they exist in multiple weeks and may have moved one or more times in different weeks.

Gysbert_Wassenaar

Can you post a qlikview document with data? That way we can try to create a solution for you. Read this document if you're worried about confidential information: Preparing examples for Upload - Reduction and Data Scrambling


talk is cheap, supply exceeds demand