Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
didierodayo
Partner - Creator III
Partner - Creator III

generate new field as another field name

Hello,

I have this scenario troubling me at the moment,

for the table below I would like:

   

questionanswerType
kloMargecamp
frostomroom
kloambcamp
fincotobuilding
frosmamboroom
woevalanbuilding
klobenocamp
vanarribuilding
daldalmetro

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

3 Replies
Siva_Sankar
Master II
Master II

Hi,

Can you give a clear information on what condition the new field should be created?

-Siva

didierodayo
Partner - Creator III
Partner - Creator III
Author

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

Siva_Sankar
Master II
Master II

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