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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
AbhishekBoga
Contributor
Contributor

Address column having comma ',' value is not converting into JSON format from Excel file

Hi All,

 

I have a task where I need to convert excel file data into JSON format. I'm able to convert the excel file but some of the data rows from file is having comma ',' values in fields say Address and that row is not converting into JSON format. 

 

Row 1 & 3 : Address1 fields is having a value with comma and due to this this row is not converted int JSON format, whereas Row 2 is not having comma and thus converted into JSON format. Refer fig.1

 

What I want is to retain the comma in the JSON format as shown in fig. 2:

 

 

0683p000009M475.png

 

Fig 2 - Pls ignore the JSON format as I might be wrong

0683p000009M49k.png

Labels (1)
6 Replies
PhilHibbs
Creator II
Creator II

Those both look identical to me, did you paste the "good" results twice?

AbhishekBoga
Contributor
Contributor
Author

Yes... bymistake pasted twice. Find the figures as below

 

Fig 1:

0683p000009M4IW.png

 

Fig 2:

0683p000009M4Ib.png

Anonymous
Not applicable

Hi @AbhishekBoga ,

 

The json form you are trying is not a valid json, please let us know the actual json form that you are trying to make.

Anonymous
Not applicable

The correct format of the JSON file is :

 

{
	"ma_liste":[
		{"id":1,
		"address1": "mon addresse1 1",
		"address2": "mon addresse1 2",
		"address3": "mon addresse1 3"}
		,
		{"id":2,
		"address1": "mon addresse2 1",
		"address2": "mon addresse2 2",
		"address3": "mon addresse2 3"}
		,
		{"id":3,
		"address1": "mon addresse3 1",
		"address2": "mon addresse3 2",
		"address3": "mon addresse3 3"}
	]	
}
AbhishekBoga
Contributor
Contributor
Author

Thank buddy for correcting JSON format.

 

Could you please help me with the solution.

Anonymous
Not applicable

I think you need to add one more column to group all the address fields. I just added an additional field in tmap named as groupcolumn. 

Job:

0683p000009M4LQ.png

 

tMap:0683p000009M4Gg.png

 

WriteJsonComponent:0683p000009M41M.png

 

Json Mapping:0683p000009M4LV.png

 The above mapping will give you the final json form as follows.

{"address_list":[{"id":1,"address1":"A/14, Grant road","address2":"St. Bolt road","address3":"Mumbai"},{"id":2,"address1":"A/14 Grant road","address2":"St. Bolt road","address3":"Mumbai"},{"id":3,"address1":"A/14, Grant road","address2":"St. Bolt road","address3":"Mumbai"}]}

 

 

Note: Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.