Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis within set analysis

Hi everyone,

I would appreciate some help with the following problem.

For each dimension, CurrentYear, I am trying to select only a single record, per CurrentYear, which has the minimum SalesCalls with the maximum SalesAmount.

I basically need set analysis within set analysis. I also need to solve the problem inside the sheet chart as opposed to within the data load.

There may be multiple rows in each year per the example below:

Header RowCurrentYearSalesCallsSalesAmount
A201151000
B20115850
C201162000
D20115350
E201031200
F201031500
G201031500

The results should show row A for 2011 and either row F or G (I just need it to be a single record).

Thanks in advance,

Craig

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Hi

maybe like attached?

The expression uses advanced aggregation and looks a bit ugly. Maybe you can simplify it, I don't get any further tonight.

(well, one aggregation and Minstring is due to the fact that you want a single record returned per CurrentYear).

Hope this helps,

Stefan

View solution in original post

4 Replies
danielrozental
Master II
Master II

You can't do this with set analysis, you need to look into the AGGR function.

swuehl
MVP
MVP

Hi

maybe like attached?

The expression uses advanced aggregation and looks a bit ugly. Maybe you can simplify it, I don't get any further tonight.

(well, one aggregation and Minstring is due to the fact that you want a single record returned per CurrentYear).

Hope this helps,

Stefan

Not applicable
Author

Thanks very much for the example and the solution Stefan.

Not applicable
Author

Thanks Daniel and I see from Stefan's solution how the AGGR function can be used to solve the problem.