Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have this scenario troubling me at the moment,
for the table below I would like:
question | answer | Type |
klo | Marge | camp |
fros | tom | room |
klo | amb | camp |
fin | coto | building |
fros | mambo | room |
woe | valan | building |
klo | beno | camp |
van | arri | building |
dal | dal | metro |
I want to load the table and in the load script generate a several new fields based on the following condition:
- If (Match(question='klo','fros')>0,answer) as """"NOW I WANT TO DYNAMICALLY NAME THE FIELD WHATEVER THE ""Type"" value is.
basically I need to dynamically generate new fields for certain questions so the new field holds the values for that question
any idea will be appreciated.
Thanks
Hi,
Can you give a clear information on what condition the new field should be created?
-Siva
Hi
so I am trying to write something similar to the below
Table1:
Load * Inline [
question, answer, Type,
klo, Marge, camp
fros, tom, room
klo, amb, camp
fin, coto, building
fros, mambo, room
woe, valan, building
klo, beno, camp
van, arri, building
dal, dal, metro
];
let vType =??????(this needs to be the type field)
load *,
if(match(question,'klo','fros')>0,answer) as $(vType)
Resident Table1;
the new fields to be generated will be names based on the Type column in table1. in this case 2 additional fields should be created (camp and room).
I have 100s to loop through that is why am looking for a dynamic method.
thanks
Hi,
Try Generic load. You can find info on Generic load here The Generic Load and use cases hereUse cases for Generic Load | Qlikview Cookbook
-Siva