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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Transform multi level JSON message to multi level JSON Output and generate a file output

I need to create a map between multi level json input file and transform using map source json format to json format and generate a multi level output json file as mentioned below.

 

Sample input : 

Order.json

 

{
"Order":
{
"@Banner": "ABCD",
"@OrderID": "123456",
"@OrderNo": "890",
"OrderLine":
[
{
"OrderedQty":"1",
"ItemID":"ITEM01",
"UnitOfMeasure":"EACH",
"ProductClass":"GOOD"
},
{
"OrderedQty":"2",
"ItemID":"ITEM02",
"UnitOfMeasure":"EACH",
"ProductClass":"MEDIUM"
}
]
}
}

 

Sample JSON output expected :

PurchaseOrder.json

<PurchaseOrder>
<PurchaseBanner></PurchaseBanner>
<PurchaseOrderID></PurchaseOrderID>
<PurchaseOrderNo></PurchaseOrderNo>
<POLines>
<POLine>
<OrderedQty></OrderedQty>
<ItemID></ItemID>
<UOM></UOM>
<ProductClass></ProductClass>
</POLine>
<POLine>
<OrderedQty></OrderedQty>
<ItemID></ItemID>
<UOM></UOM>
<ProductClass></ProductClass>
</POLine>
</POLines>
</PurchaseOrder>

 

Labels (3)
1 Reply
Anonymous
Not applicable
Author

I managed to get it working using approach mentioned below.

 

tFileInputJson --> tWriteJsonField --> tFileOutputRaw

 

Note : I am using tFileOutputRaw instead of tFileOutputJson as i am already parsing the data in tWriteJsonField.

 

Any comment of better practice to improve my solution and maping the same is much appreciated.


json2json_Order2PO_Transform6.zip