Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
Partner
Partner

Dynamic word combination

Hi guys,

I have a list of words like this :

a,e,i,o,u,1,2,3,4,5

and I'd like to have a new word of 5 character lenght with all the possible combinations dynamically.

Example :

Id,NewWord

1, aaaaa

2,aaaae

....

Anybody here knows how to do that avoiding to do it with 5 nested for next loops? The point here is my issue is much complicated than this, and maybe there's a string function that will do what I want.

Regards, Marcel.

1 Solution

Accepted Solutions
MVP
MVP

Re: Dynamic word combination

Maybe using an outer JOIN to create all combinations:

Words:

LOAD * INLINE [

Word

a,

e,

i,

o,

u,

1,

2,

3,

4,

5

];

For i = 1 to 5

If i = 1 THEN

Prefix = 'Combinations:'

ELSE

Prefix = 'Join (Combinations)';

endif

$(Prefix)

LOAD Word as Word$(i) Resident Words;

Next i

If needed, you can concatenate each WordX to create a single field for the combinations in another step.

2 Replies
MVP
MVP

Re: Dynamic word combination

Maybe using an outer JOIN to create all combinations:

Words:

LOAD * INLINE [

Word

a,

e,

i,

o,

u,

1,

2,

3,

4,

5

];

For i = 1 to 5

If i = 1 THEN

Prefix = 'Combinations:'

ELSE

Prefix = 'Join (Combinations)';

endif

$(Prefix)

LOAD Word as Word$(i) Resident Words;

Next i

If needed, you can concatenate each WordX to create a single field for the combinations in another step.

Partner
Partner

Re: Dynamic word combination

Thanks Stephan, it's what I need. I'll concatenate each wordX in a resident load after it.

Best regards, Marcel.