Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am facing issue with below requirement, can anyone help me.
I have inline table like below:
LOAD * INLINE [
ID, Catgeory
1, AB
1, BC
1, DE
1, EF
1, GH
1, HI
2, AB
2, BC
2, DE
2, EF
2, GH
2, HI
3, AB
3, BC
3, DE
3, EF
3, GH
3, HI
];
In present layer i want see only one record respective id and base of which is primary stick for Category..
Output:
Ex:
ID, Category
1, AB
2, AB
3, AB
Please help me asap.
Thanks, Surya.
Are you looking to see the first instance of Category for each ID? May be try to create a flag in the script:
Table:
LOAD *,
If(ID = Previous(ID), 0, 1) as Flag;
LOAD * INLINE [
ID, Catgeory
1, AB
1, BC
1, DE
1, EF
1, GH
1, HI
2, AB
2, BC
2, DE
2, EF
2, GH
2, HI
3, AB
3, BC
3, DE
3, EF
3, GH
3, HI
];
and then a straight table
Dimension
ID
Expression
=Only({<Flag = {1}>}Catgeory)
Hi Surya,
This:
Data:
LOAD
AutoNumber(Category,ID) as CategoryIndexByID,
*;
LOAD * INLINE [
ID, Category
1, AB
1, BC
1, DE
1, EF
1, GH
1, HI
2, AB
2, BC
2, DE
2, EF
2, GH
2, HI
3, AB
3, BC
3, DE
3, EF
3, GH
3, HI
];
Will rank the categories for each ID based on the order they are loaded.
This table shows the ID with the first Category loaded for each.
ID | Concat({$<CategoryIndexByID = {1}>}Category,', ') |
---|---|
1 | AB |
2 | AB |
3 | AB |
Cheers
Andrew
If you select AB in the application, it will show you this value for all IDs. Are you looking for Always One Selected value in List Box ‒ QlikView ? This setting can force one category to always be selected, and then you always get one category in your objects.