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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
pkonderla
Contributor
Contributor

Qlik Sense Load array pairs from database.

Does anyone has experience how to load/prepare data:

[(1, 'a'), (2, 'b'), (3, 'c'), (4, 'd')]

taken from SQL database (stored there as value) into qlik sense table:

ID,Value
1,a
2,b
3,v
4,d

Thanks

 

1 Solution

Accepted Solutions
Digvijay_Singh
MVP
MVP

Something like this, but I guess you might struggle a bit in handling few chars like '[ ]' in your input

 

Load ID,PurgeChar(Value,CHR(39)) as Value1
;
Load subfield(input1,',',1) as ID,
subfield(input1,',',2) as Value,
;
Load purgechar(subfield(input,'),'),'()[]') as input1;
Load * inline [
input
"(1, 'a'), (2, 'b'), (3, 'c'), (4, 'd')"
];

View solution in original post

3 Replies
Digvijay_Singh
MVP
MVP

Not sure but subfield(Fieldname,',') can help in creating separate row for each combination and then later you can separate each combination into ID and Value.

Thanks,

Digvijay_Singh
MVP
MVP

Something like this, but I guess you might struggle a bit in handling few chars like '[ ]' in your input

 

Load ID,PurgeChar(Value,CHR(39)) as Value1
;
Load subfield(input1,',',1) as ID,
subfield(input1,',',2) as Value,
;
Load purgechar(subfield(input,'),'),'()[]') as input1;
Load * inline [
input
"(1, 'a'), (2, 'b'), (3, 'c'), (4, 'd')"
];

pkonderla
Contributor
Contributor
Author

Works like charm, thanks...