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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
pauljohansson
Creator III
Creator III

From Variable list to field


Hi,

anyone that can share a code snippet to create a field from variable list (Note, the variable contain several values).

Example, the following list should be transformed to a field with 3 rows:

VariableList:  '202001', '202002', '202003';

Thanks in advance,

br
Paul

1 Solution

Accepted Solutions
pauljohansson
Creator III
Creator III
Author

Found it myself, script function subfield magically creates several rows:

 

set vGO = '201902','201903','202004';
let CountYearMonths = num(SubStringCount('$(vGO)', ','))+1;

NrOfMonths:
Load
mid(YearMonth, 2,6) as YearMonth;
Load
subfield('$(vGO)', ',') as YearMonth
autogenerate(1);

View solution in original post

1 Reply
pauljohansson
Creator III
Creator III
Author

Found it myself, script function subfield magically creates several rows:

 

set vGO = '201902','201903','202004';
let CountYearMonths = num(SubStringCount('$(vGO)', ','))+1;

NrOfMonths:
Load
mid(YearMonth, 2,6) as YearMonth;
Load
subfield('$(vGO)', ',') as YearMonth
autogenerate(1);