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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Bharath12
Contributor III
Contributor III

how to convert delimited values to json array and key value pair

Hi All,

 

I have issues with converting delimited values  to JSON array. can some one help me with the below requirements.

 

Requirement 1:

 

source from mysql DB:

id

123,456,7458,4566897,32132164

 

I need JSON output like below.

 

"ID":["123","456","7458","4566897","32132164"]

 

Requirement 2: 

source data

work email                                                 Alias

12345@gmail.com                        xyz@gmail.com,abc@gmail.com,cyd@gmail.com

 

i need output like below

 

"email" : [ {"type" : "workemail", "value" : "12345@gmail.com" }, {"type" : "alias", "value" : "xyz@gmail.com" }, {"type" : "alias", "value" : "abc@gmail.com" }, {"type" : "alias", "value" : "cyd@gmail.com" }].

 

Can some one help me with the above seniors. Appreciate your help.

 

Thanks, 

 

 

 

 

 

 

Labels (4)
11 Replies
Bharath12
Contributor III
Contributor III
Author

Thanks @uganesh . Can you please help me for the below example.

 

Requirement 1:

 

source from mysql DB:

id

123,456,7458,4566897,32132164

 

I need JSON output like below.

 

"ID":["123","456","7458","4566897","32132164"]

akumar2301
Specialist II
Specialist II

Hello ,

In attached job , you have solution for both. Approach is similar so did
not explain it.

Also by error you have selected your comment as accepted solution. Marking
correct comment would help others.