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: 
mks02
Creator
Creator

Extracting fileds from JSON file

Hi All,

I have a input file with multiple JSON records as below. I need to load this file to DB tables.

 


{
"EmpEntry":[
{
"Id":"11",
"Name":"ABC",
"JoinDate":"2018-11-05",
"JoinType":"FUNCTION",
"Mngr":"AAAAAAAAA",
"DIV":[
{
"SNo":1,
"acN":"103",
"AMNT":"55000.00",
}
],
"SUBDIV":[
{
"SNo":7,
"acN":"211",
"AMNT":"5000.00",
},
{
"SNo":3,
"acN":"212",
"AMNT":"50000.00",
}
],
"status":"SUCCESS",
}
]
}


I am new to JSON file and in talend job, I have facing a scenario describe below:

For "Div" element, its "SUBDIV" records should display to seperate rows. DIV can have multiple SUBDIV entries in file.
Expected Output:

Id;Name;JoinDate;JoinType;mgr;DIV_Sno;DIV_ACN,DIV_AMNT;SUBDIV_Sno;SUBDIV_ACN,SUBDIV_AMNT;status
11;ABC;2018-11-05;FUNCTION;AAA;1;103;55000;7;211;5000;SUCCESS
11;ABC;2018-11-05;FUNCTION;AAA;1;103;55000;3;212;50000;SUCCESS

 

i.e. SUBDIV should be display in separate rows.




Thanks,

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi,

 

   I believe you are looking for below solution.

0683p000009M8fE.png

 

The component details are as shown below.

0683p000009M8fJ.png

 

0683p000009M8T2.png

 

0683p000009M8KJ.png

 

Solution courtesy goes to @rhall  🙂

(https://community.talend.com/t5/Design-and-Development/JSON-Array-values-to-Rows-is-there-a-better-w...)

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

View solution in original post

2 Replies
Anonymous
Not applicable

Hi,

 

   I believe you are looking for below solution.

0683p000009M8fE.png

 

The component details are as shown below.

0683p000009M8fJ.png

 

0683p000009M8T2.png

 

0683p000009M8KJ.png

 

Solution courtesy goes to @rhall  🙂

(https://community.talend.com/t5/Design-and-Development/JSON-Array-values-to-Rows-is-there-a-better-w...)

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

mks02
Creator
Creator
Author

Thanks @nthampi , it worked for me.