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: 
narayanaqlik
Creator
Creator

To Load Field Values into a variable How?

Hi All,

I have taken DB tableNames and required fields in Excel by creating Fields 'DBTables" ,"RequiredFields"

here I want to load all Required Fields into one variable how

like

DB Table, Status, Required Field

ABC,           Yes,     abcers

ABC,           yes,     cbbge

ABC            Yes      nbc

CBA            yes       BNH

CBA           yes       CVB

CBA           Yes       GHJ

CBA           Yes       RTY ....

I have loaded entire Excel

so here i have filter it out where DB Table='ABC' and Status='YES' so all the fields related ABC will come

Here all the values in "Required Field" need to load into a variable How?


Could you any plz help..


No I have tried that

let vTableColoumns=Concat( Distinct 'RequiredFields');

it is pickuping any values just zero only

Thanks..

2 Replies
pradosh_thakur
Master II
Master II

=concat( distinct RequiredFields)  or =concat( distinct {1} RequiredFields)   may be

Learning never stops.
marcus_sommer

You need to use concat within a load and then using peek() to grab this value from there, maybe in this way:

t:

load [DB Table], concat([Required Field], ', ') as FieldList

from Excel group by [DB Table] where DB Table='ABC' and Status='YES'

let v = 'select ' & peek('FieldList', 0, 't') & ' from ' & peek('DB Table', 0, 't') & ';';

and then maybe:

$(v);

- Marcus