Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I want to load the first row for each dimension based on the load order. (This is using script) For example:-
Category | Class |
---|---|
A | 2000 |
A | 1000 |
A | 4000 |
B | 5000 |
B | 2000 |
B | 1000 |
C | 1000 |
C | 6000 |
C | 5000 |
The result that I want to get is:
A - 2000
B - 5000
C - 1000
I'm trying to use the FirstSortedValue function, but it require a sort weight (which I can't give). Any way to solve this?
Thanks!
Try this:
Table:
LOAD Category,
FirstValue(Class) as Class
FROM
[https://community.qlik.com/thread/170514]
(html, codepage is 1252, embedded labels, table is @1)
Group By Category;
Output:
Try this:
Table:
LOAD Category,
FirstValue(Class) as Class
FROM
[https://community.qlik.com/thread/170514]
(html, codepage is 1252, embedded labels, table is @1)
Group By Category;
Output:
See attached
Hi khim_hoe,
Please use this script.
FirstValueTbl:
Load * Inline [
Category,Class
A,2000
A,1000
A,4000
B,5000
B,2000
B,1000
C,1000
C,6000
C,5000
];
FirstValue:
LOAD Category,FirstValue(Class) AS ClassNew
Resident FirstValueTbl
Group By Category;
Thanks, it works!