Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Parse json containing hashmap

Hello,

 

I need to get key value pairs of hashmap in the data attribute in below json. Can I please know how to get the key value pairs ? I could not fetch them during metadata scanning for json input. I could easily get name and id. Please see attached snapshot. I need to fetch and parse hashmap present in data attribute.

 

[
  {
    "name": "location",
    "id": 20,
    "data": {
      "2018-09-06T00:00:00": 36.0,
      "2018-09-06T00:10:00": 64.0,
      "2018-09-06T00:20:00": 88.0,
      "2018-09-06T00:30:00": 52.0,
      "2018-09-06T00:40:00": 10.0
    }
  }
]

  

Labels (3)
1 Reply
Jesperrekuh
Specialist
Specialist

Dont bother trying those JSON components... maybe just for extracting the data object(s).
Go for regex and extract everything with "data" : {..... } and iterate over the results.
Next iterate over the key-values and do the conversion/mapping yourself.
Use a tJavaFlex , preCode, mainCode, postCode ...