Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
vicentef
Contributor
Contributor

Extract JSON data diferent levels

I want to extract JSON data from a file and update a database with the data that i extracted from my file.

 

The code bellow represents my JSON data simplified :

 

 

{
  "data": {
    "uniqueIdData": "1",
    "datecreat": "2019-09-23",
    "libelle": "Septembre 2019",
    "user": "user.user@user.com",
    "date": "2019-09-23 00:00:00",
    "user": [
      {
        "uniqueId": "1",
        "expenseDate": "2019-09-23",
        "categoryName": "Car",
        "categoryType": "Car",
        "approb": [
          {
            "lvl": 1,
            "user": "user1.user@user.com",
            "date": "2019-09-26 00:00:00"
          }
        ],
        "verif_user": "user2.user@usercom",
        "verif_date": "2019-09-26 00:00:00",
        "compta_user": "user3.user@user.com",
        "compta_date": "2019-09-30 00:00:00",
        "code_projet": "PROJECTX"
      },
      {
        "uniqueId": "2",
        "expenseDate": "2019-09-24",
        "categoryName": "Fuel",
        "categoryType": "Fuel",
        "approb": [
          {
            "niv": 1,
            "user": "user2.user@user.com",
            "date": "2019-09-26 00:00:00"
          }
        ],
        "verif_user": "user2.user@user.com",
        "verif_date": "2019-09-26 00:00:00",
        "compta_user": "user3.user@user.com",
        "compta_date": "2019-10-05 00:00:00",
        "code_projet": "PROJECTY"
      }
    ]
  }
}

 

 

As you cans see the are 3 levels data =>  users => aprob.

 

0683p000009M8eg.pngJob struct

 

What i have :

 

0683p000009M8ep.pngResult

What i want to have :

0683p000009M8eu.pngObjectif

2 Replies
Anonymous
Not applicable

Hi
Read by 'Xpath' model and set the loop xpath as "/data/user/approb", you should be able to extract all records.

Regards
Shong
uzix
Creator
Creator

hello 

 

if still interested i have solution.

 

just reply and i post solution.