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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
jemi
Contributor II
Contributor II

Array in JSON

I have a JSON column (calculatedvalues) in a table (saleitem) in SQL. I want to extract those values in QlikSense. I extracted them by writing the script:

LOAD * From_Field(Saleitem, calculatedvalues) (json, utf8, no labels);

It worked. But in the same column, there's an array. How do we extract those values?

Normally, most of the rows in the calculatedvalues column is similar to this:

"reversetax":0,"discountrate":0,"taxexclusiverp":7500,"taxexclusive_discountedsaleprice":7500,"saletaxes_rate":[],"roundedbilledvalue":7500,"roundedconcession":0,"roundedamount":7500,"accountsubtotal":7500,"accountgrandtotal":7500,"accountprecisegrandtotal":7500,"accountroundoff":0,"accounttotalconcession":0,"accounttotaltax":0 }

But I have few rows in the JSON column as follows:

{"reversetax":20.097457627118647,"discountrate":0.1,"taxexclusiverp":111.65254237288136,"taxexclusive_discountedsaleprice":100.48728813559322,"saletaxes_rate":[{"taxId":"E5F07E78-1081-4DAC-B57E-E344ADCC4541","title":"CGST","percent":9,"rate":0.09,"amount":9.043855932203389,"totaltaxamount":9.043855932203389,"roundedtotaltaxamount":9.04},{"taxId":"B0E910B5-A841-4460-8CC5-F068A13337C4","title":"SGST","percent":9,"rate":0.09,"amount":9.043855932203389,"totaltaxamount":9.043855932203389,"roundedtotaltaxamount":9.04}],"roundedbilledvalue":131.75,"roundedconcession":13.18,"roundedamount":118.57,"accountsubtotal":691.75,"accountgrandtotal":623,"accountprecisegrandtotal":622.58,"accountroundoff":0.42,"accounttotalconcession":69.18,"accounttotaltax":79.22,"accountcompanycredit":0,"accountpatientcash":622.58,"accountroundedpatientcash":623,"accountpatientcredit":0}

I am not getting the salestaxes_rate as separate column.

 

How do we do that? Any help would be highly appreciated

Labels (1)
0 Replies