Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Micki
Creator
Creator

Build Column from variables in Load script

Hi, 

 

Does somebody know, how to build column in a table from variables 

i have $(var1), $(var2), $(var3)

My desired output should be table with column like:

Col1: 

var1,

var2

var3

 

Thanks 

1 Solution

Accepted Solutions
Micki
Creator
Creator
Author

OK, thank you all but i found it at first i generate dummy table with auto generate based on count how many non empty variables ,  then i used CROSSTABLE to get the result and just uncut the unneeded fileds, quite a funny solution but it works,  i will post later code

View solution in original post

6 Replies
sunny_talwar

Does these variables have multiple values or just single value? If they have multiple values, how are you creating these variables in the first place?

PrashantSangle

can you explain little bit more??

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Micki
Creator
Creator
Author

Hi, only single value ( like some names of operations 'Service', 'Main',  etc.)

sunny_talwar

Just do this

Col1:
LOAD '$(var1)' as var1,
     '$(var2)' as var2,
     '$(var3)' as var3
AutoGenerate 1;
Micki
Creator
Creator
Author

actually it's generate not a column but one row

 var1var2var3

, but i need it as a column in one table 

Col1
 var1
var2
var3

 

 

Micki
Creator
Creator
Author

OK, thank you all but i found it at first i generate dummy table with auto generate based on count how many non empty variables ,  then i used CROSSTABLE to get the result and just uncut the unneeded fileds, quite a funny solution but it works,  i will post later code