Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

koushik_btech20
Contributor

Generic key creation through 8 fields

Hi Everyone,

I have total 8 columns and based on 8 columns I am creating generic keys based on the Basics for complex authorization blog post using concatenate each and .every load statements. So for 8 fields I have to write 64 times load statements which is not so much feasible manually. So is there any way through which we can generate 64 lines of load statement in a single load statements through some for loop and other techniques??

Please  have a look and share idea.

Regards,

Koushik

4 Replies
sushil353
Honored Contributor II

Re: Generic key creation through 8 fields

you can store that piece of code in a variable and the use that where ever you want

SET vConcat = 'F1&F2&F3';

Load

$(vConcat)

,*

From TableX

koushik_btech20
Contributor

Re: Generic key creation through 8 fields

Thanks for sharing this . This is fine that ultimately I have to pass some variable in the load statement but each and every load statement the concat combination will change . Like let say,

1st combination - F1&F2&F3

2nd combination- F1&F2&'<ANY>'

3rd combination - F1&'<ANY>'&F3

.

...

so on.

So for that how I mange this as dynamically??

sushil353
Honored Contributor II

Re: Generic key creation through 8 fields

For that you can create a mapping table such as;

Temp:

Load * inline

[

TableName,Fields

Table1,F1&F2&F3

Table2,F1&F2&F4

Table3,F1&F3

];


Now based on the table name you can get the values in a variable using peek


LET vcondition = peek(Fields,0,'Temp')

HTH

Sushil

koushik_btech20
Contributor

Re: Generic key creation through 8 fields

Send me the exact solution and also consider '<ANY>' while concatenating the fields.