Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
gauthamchilled
Creator
Creator

auth key combinations

The following is a possible key combination for 4 fields, X and _ to create auth key (based on section access more than one field | Qlik Community)

Load XXXX as Key from Transactions

Load _XXX as Key from Transactions

Load X_XX as Key from Transactions

Load XX_X as Key from Transactions

Load XXX_ as Key from Transactions

Load __XX as Key from Transactions

Load XX__ as Key from Transactions

Load _XX_ as Key from Transactions

Load X_X_ as Key from Transactions

Load _X_X as Key from Transactions

Load X__X as Key from Transactions

Load ___X as Key from Transactions

Load __X_ as Key from Transactions

Load _X__ as Key from Transactions

Load X___ as Key from Transactions

Load ____ as Key from Transactions

I want to create similar kind for 5 fields(XXXXX)..can any one help me how to generate possible keys for the 5 fields?

Thanks.

Gautham

1 Solution

Accepted Solutions
giakoum
Partner - Master II
Partner - Master II

maybe something like this :

FOR Each vValue1 in 'X','_'

  LET p1 = '$(vValue1)';

  FOR Each vValue2 in 'X','_'

  LET p2 = '$(vValue2)';

  FOR Each vValue3 in 'X','_'

  LET p3 = '$(vValue3)';

  FOR Each vValue4 in 'X','_'

  LET p4 = '$(vValue4)';

  FOR Each vValue5 in 'X','_'

  LET p5 = '$(vValue5)';

  final:

  LOAD

  '$(p1)' & '$(p2)' & '$(p3)' & '$(p4)' & '$(p5)' as final

  AutoGenerate(1);

  NEXT

  NEXT

  NEXT

  NEXT

NEXT

;

View solution in original post

2 Replies
gauthamchilled
Creator
Creator
Author

i just need to create combinations of 5 fields

eg

F1,F2,F3,F4,F5

F1,F2,F3,F4,ANY

F1,F2,F3,ANY,F5

....

....

like this

i want to create keys for auth table.somehow i dont know easiest way to create all possible combinations

giakoum
Partner - Master II
Partner - Master II

maybe something like this :

FOR Each vValue1 in 'X','_'

  LET p1 = '$(vValue1)';

  FOR Each vValue2 in 'X','_'

  LET p2 = '$(vValue2)';

  FOR Each vValue3 in 'X','_'

  LET p3 = '$(vValue3)';

  FOR Each vValue4 in 'X','_'

  LET p4 = '$(vValue4)';

  FOR Each vValue5 in 'X','_'

  LET p5 = '$(vValue5)';

  final:

  LOAD

  '$(p1)' & '$(p2)' & '$(p3)' & '$(p4)' & '$(p5)' as final

  AutoGenerate(1);

  NEXT

  NEXT

  NEXT

  NEXT

NEXT

;