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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sorting Data - First sorted value - Pulling corresponding Text Field

Hi

I am struggling putting together a summary table for the Base set of data below.

YearTeamCount
2011A

5

2011B6
2011C4
2011D9
2012A8
2012B2
2012C4
2012D5

I want the summary table to look like the one below.

YearTeamCount
2011C4
2012B2

The table displays the Min count per year and the corresponding teams to that min count. The part i am struggling with is pulling though the corresponding teams. I have tried first sorted value but that doesn't seem to work I need a formula that pulls through the Team

Thanks for your help

13 Replies
Not applicable
Author

Here you are my script:

// *****  Data Source  ***************************
Data:
LOAD * INLINE [
Year, Team, Count
2011,  A,   5
2011, B,   6
2011, C,   4
2011, D,   9
2012, A,   8
2012, B,   2
2012, C,   4
2012, D,   5
]
;
/*
Sort:
load
Year,
Team,
max(Count)
Resident Data Group By Year, Team;
*/

Sort:
load
Year,
min(Count) as Count
Resident Data
group by Year;

left Join

LOAD
Year,
Count,
Team
Resident Data;


drop table Data;

Hope it will help you

Anonymous
Not applicable
Author

hi,

the following will help u for sure...

PFA

 




 

nagaiank
Specialist III
Specialist III

Assuming the data is loaded using the script

Data:

LOAD * INLINE [
Year,
Team, Count
2011, A, 5
2011, B, 6
2011, C, 4
2011, D, 9
2012, A, 8
2012, B, 2
2012, C, 4
2012, D, 5
];

define the properties of the Summary table as below:

Dimension: Year

Expression 1 (for Team column) : FirstSortedValue(Team,Count)

Expression 2 (for Count column): FirstSortedValue(Count,Count)

With the above properties, the summary table will respond to the selections in the Data table fields.

prasadmundewadi
Contributor III
Contributor III

I tried this script and somehow it is not working. Here is a screenshot. FirstOrderValue always return null for me.1.png