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: 
ves_diego
Contributor
Contributor

Map CSV file to Structured Json

Hello everyone!

I need to map to CSV file to a JSON by changing the structure, for example:

CSV file:

0693p00000AFKKmAAP.png

And this is the JSON file:

0693p00000AFKNbAAP.png

Any suggestions?

I'm trying to use tFileInputJSON and tFileOutputJSON with the tMap but without success

Thank you

Labels (2)
4 Replies
Ravi_Rajagopal
Contributor III
Contributor III

Please copy/paste the flow of the job. Also I would like to see the schema of the csv and json as you read the data in and I would like to see the tMap configuration as well.

ves_diego
Contributor
Contributor
Author

thank you.

i'm changing approach using the tWriteJSONfield:

0693p00000AFQ9aAAH.pngthis is the csv schema:

and the json structure:

with the tWriteJSONField i created this JSON tree:

Now the output is good, but it's not the same as the main structure.

I have 2 (main) problems:

1) how can i add the array

"aspectNames": ["dcr:commonDCR"]

with tWriteJSONField ?

2) in some key, for example "dcr:caseID" i have to add the prefix "dcr:", but when i try to add it in the json tree like a "sub-element", i have this error:

"The prefix "dcr" for element "dcr:caseID" is not bound."

 

thank you

 

 

ves_diego
Contributor
Contributor
Author

CSV Schema:

0693p00000AFQAYAA5.png 

JSON Structure:0693p00000AFQAdAAP.png 

JSON tree:

0693p00000AFQAiAAP.png

ves_diego
Contributor
Contributor
Author

have you an idea please?