Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I need to fully transpose my table. I have two Columns: key and value, with 12 values.
I need the 12 to-be-columns to be called as the relative "Key" column values, and the values of each to-be-column (only 1 value per column) to be the "values" column values.
I tried Generic Keyword but it creates distinct tables, and it's a problem since i don't know (and cannot know) the future column name a-priori. (i'm thinking roght now to a loop cycling trough the distinct names of the columns and use them as variables to create the join, but I really hope it exists a smarter way!)
Example
before:
Key | Value |
Attribute_Name_1 | Value_1 |
Attribute_Name_2 | Value_2 |
Attribute_Name_3 | Value_3 |
After:
Attribute_Name_1 | Attribute_Name_2 | Attribute_Name_3 |
Value_1 | Value_2 | Value_3 |
Thank you
If there's always 12 values, I would just brute force it instead of working through the issue with variables or similar solutions (concatenating the values and using SubField, perhaps?).
Load Key as Field1, Value as Value1 From Table where WildMatch(Key,'*_1');
Concatenate
Load Key as Field2, Value as Value2 From Table where WildMatch(Key,'*_2');
etc.
There are surely various manually ways to transform the table but I think you should not disregard the generic approach too easily else considering it as base to extend/adjust it to your needs. Therefore take a more closely look on the possibilities: The Generic Load - Qlik Community - 1473470