Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Say I have a table with some pretty standard fields:
ID (prim key)
Name
Type_ID (for key)
Value
and I would like to create a different table within qlikview for each unique type_id. How would I do this? Obv I can always add a where clause in my SELECT statement and just assign different names to each field where applicable and name the tables, but the number of types may grow. Can this be done?
Not sure if I fully understood, but maybe like this?
Table:
LOAD * INLINE [
ID, Name, Type_ID, Value
1, One, Number, 10
2, Two, String, 20
3, Three, Number, 30
4, Four, String, 40
];
TypeTable:
LOAD Distinct Type_ID as TypeName resident Table;
For i = 0 to NoOfRows('TypeTable')-1 step 1
Let type = peek('TypeName', $(i), 'TypeTable');
[$(type)]:
NOCONCATENATE Load ID, Name as $(type)Name, Value as $(type)Value resident Table where Type_ID = '$(type)';
Next
Regards,
Stefan
Not sure if I fully understood, but maybe like this?
Table:
LOAD * INLINE [
ID, Name, Type_ID, Value
1, One, Number, 10
2, Two, String, 20
3, Three, Number, 30
4, Four, String, 40
];
TypeTable:
LOAD Distinct Type_ID as TypeName resident Table;
For i = 0 to NoOfRows('TypeTable')-1 step 1
Let type = peek('TypeName', $(i), 'TypeTable');
[$(type)]:
NOCONCATENATE Load ID, Name as $(type)Name, Value as $(type)Value resident Table where Type_ID = '$(type)';
Next
Regards,
Stefan
Thanks I'll try this out. It looks like it might be what i'm looking for.