Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
agni_gold
Specialist III
Specialist III

Load with variable values

Hi friends,

I have column values in one variable like ,

variable name : vField

'A','B','C'

i want to load like

Load $(vField)  from XYZ.qvd (qvd);

but it is not loading , can you guys help

6 Replies
agni_gold
Specialist III
Specialist III
Author

also tried like

"A","B","C"


but not

krishnacbe
Partner - Specialist III
Partner - Specialist III

Hi,

Please find the attached sample.

agni_gold
Specialist III
Specialist III
Author

DimensionMax:

Load count(Header)  AS Count ,

     Header  AS Field

   //  Concat(Chr(91) & Header & Chr(93), ',',Load_Order) AS Fields

Resident Column_Header_temp

Group by Header

order by Load_Order;

Drop Table Column_Header_temp;

Let vNoofField= NoOfRows('DimensionMax');

Let vFields2=Peek('Field',0,'DimensionMax');

For i=0 to NoOfRows('DimensionMax')-1

Let vFields1 = Peek('Field',0,'DimensionMax');

Let vFields = Concat(Chr(91) & Peek('Field',$(i),'DimensionMax')& Chr(93), ',');

Next

bold line is not working for me can you please tell what wrong i am doing ?

tamilarasu
Champion
Champion

Hi Agnivesh,

Try this,

DimensionMax:

Load count(Header)  AS Count ,

     Header  AS Field

Resident Column_Header_temp

Group by Header

order by Load_Order;

Drop Table Column_Header_temp;


Temptable:

Load Concat(Chr(39) & Field & Chr(39),', ') as Field_Names

Resident DimensionMax;

Let vFields = Peek('Field_Names',0,'Temptable');

DROP Table Temptable;

krishnacbe
Partner - Specialist III
Partner - Specialist III

You should use SET instead of LET.

Set vFields = Concat(Chr(91) & Peek('Field',$(i),'DimensionMax')& Chr(93), ',');