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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to combine 2 variables into 1?

For example,

var_1: 1,4,7

var_2: 2,4,8

=>

var: 1,2,4,7,8

How to achieve it by macro?

2 Replies
disqr_rm
Partner - Specialist III
Partner - Specialist III

Does it has to be macro? YOu can also do it in QV script, which would be my preference:


LET v1 = '1,2,3';
LET v2 = '2,4,5,6';
t1:
LOAD trim(subfield('$(v1)' & ',' & '$(v2)', ',')) as t1
AutoGenerate 1;
t2:
LOAD Concat(DISTINCT t1, ',') as t2
Resident t1
Group by 1;
LET v3 = peek('t2');
DROP Tables t1, t2;


Anonymous
Not applicable
Author

Hi Rakesh, I prefer it can be achieve in Macro, because it needn't reload again.