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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
root
Creator II
Creator II

Help - tWriteJsonField (Duplicate Rows)

I have some data which I need to create a JSON.

My sample data shows like this:

0683p000009M13Y.pngRaw Data0683p000009M13d.pngtWriteJson - Properties

Column dup_code/ dup_desc is the trouble point. What is happening is that the output JSON is repeating the whole JSON content. I guess its a limitation of being able to set a single loop element.

 

I am trying to get an output where the data is not duplicated.

{
	"My_Data": {
		"metadata": {
			"name": "name",
			"zip": "zip"
		},
		"op": [{
			"m_id": "1",
			"f_dt": "2011-01-01",
			"t_dt": "2011-02-01",
			"x": [{
				"x_position": "1",
				"x_code": "dc1"
			}, {
				"x_position": "2",
				"x_code": "dc2"
			}, {
				"x_position": "3",
				"x_code": "dc3"
			}],
			"dup": [{
				"dup_code": "dup1",
				"dup_desc": "dup1_desc"
			}, {
				"dup_code": "dup2",
				"dup_desc": "dup2_desc"
			}]
		}, {
			"m_id": "2",
			"f_dt": "2011-02-01",
			"t_dt": "2011-03-01",
			"x": {
				"x_position": "3",
				"x_code": "dc3"
			},
			"dup": {
				"dup_code": "c1",
				"dup_desc": "c1_desc"
			}
		}]
	}
}

 

What are my options here?

 

Attached is my job for ready reference

 

Thanks in advance

Labels (4)
1 Reply
root
Creator II
Creator II
Author

Shameless bump. Any help please?