Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Experts,
I am very new to QlikView, I have a scenario could you please help me in getting it.
I have a table in that I have a column say Category and it has values like A,B,C,D but in front end I want to see them as A1, B2, C3, D4.
This renaming of values I managed to achieve by using following function:
if(match(Category,'A'),'A1',
if(match(Category,'B'),'B2',
if(match(Category,'C'),'C3',
if(match(Category,'D'),'D4',Category)))) as Category
Now I want to group these categories like Group 1 (A and B) & Group 2(C and D)
And in front end I will have 2 filters : Category & Group
which will be like :
Category Group
A1 Group 1
B2 Group 2
C3
D4
So now I want is when Group 1 is selected in filter A1 & B2 gets enabled and when Group 2 is selected C3 & D4 gets enabled and vice-versa.
Please help in achieving this.
Thanks,
Shan
one option is to use the pick match
....
pick(match(Category, 'A', 'B', 'C', 'D'), 'A1', 'B2', 'C3', 'D4') as Category,
pick(match(Category, 'A', 'B', 'C', 'D'), 'Group 1', 'Group 1', 'Group 2', 'Group 2') as Group,
....
May be as below:
Data:
Load ID,
if(Category='A','A1',
if(Category='B','B2',
if(Category='C','C3',
if(Category='D','D4',Category)))) as Category,
If(Category='A' or Category='B','Group 1',
If(Category='C' or Category='D','Group 2')) as Group
;
Load * Inline [
ID,Category
1,A
2,B
3,C
4,D
];
one option is to use the pick match
....
pick(match(Category, 'A', 'B', 'C', 'D'), 'A1', 'B2', 'C3', 'D4') as Category,
pick(match(Category, 'A', 'B', 'C', 'D'), 'Group 1', 'Group 1', 'Group 2', 'Group 2') as Group,
....
In addition to Massimo's suggestion above, you could also use a hierarchy if you want:
Hi,
one example of a listbox displaying a drill down group that might suit your needs:
tabFilters:
LOAD * INLINE [
Cat, Category, Group
A, A1, Group1
B, B2, Group1
C, C3, Group2
D, D4, Group2
];
table1:
LOAD RecNo() as ID,
Chr(65+Floor(Rand()*5)) as Cat,
Ceil(Rand()*100) as SomeFact
AutoGenerate 20;
hope this helps
regards
Marco
Thanks a lot Thirumala for your response.
Thanks a lot Massimo for you response, option provided by you is simple and works perfectly for me.
Thanks Marco for your response. I got the solution from Massimo option. But sure I will try what you have explained, it will help me learning new options in QlikView.