Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Reading an "Inputparameter" Array

Hi,

this Code works, but it's not nice - how can i do it better?

// This will be later set by the Publisher
Set Inputparameter = '20090930','20090831','20081231';
//

set i = 0;

For each v IN $(Inputparameter)
if i= 0 then
Set RevaluationDate = $(v);
end if
if i= 1 then
Set PrevMonthDate = $(v);
end if
if i= 2 then
Set EndYearDate = $(v);
end if
Let i = i + 1;
NEXT

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Oleg's reponse may be more pertinent to your specific scenario, but as to the general question of parsing an array:

Set Inputparameter = '20090930','20090831','20081231';
LET RevaluationDate = pick(1,$(Inputparameter));
LET PrevMonthDate = pick(2,$(Inputparameter));
LET EndYearDate = pick(3,$(Inputparameter));

View solution in original post

3 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

You can have multiple input parameters, both from the command line and from Publisher, without the need in parsing a single parameter...

Ask me about Qlik Sense Expert Class!
Not applicable
Author

Hi Ole,

thanks fpr your replay! But this doesn't work! Under "Script Parameters" it is written:

A separate document will be created for each value. To use a sequence of data enter the start and stop values separated with a "-". Separate single values or sequences with a ";".If you select a field from the document all values in the field will be used.

But I need all parameters in on Projekt. The code I wrote work fine - but I think, there will be a better practice for that!

regards Volker

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Oleg's reponse may be more pertinent to your specific scenario, but as to the general question of parsing an array:

Set Inputparameter = '20090930','20090831','20081231';
LET RevaluationDate = pick(1,$(Inputparameter));
LET PrevMonthDate = pick(2,$(Inputparameter));
LET EndYearDate = pick(3,$(Inputparameter));