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

Announcements
Now accepting applications for the Qlik Luminary and Partner Ambassador Programs: Apply by July 6!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Convert Json to CSV with space

Hi,

 

I have a json payload with 50 fields. I need to convert the same and upload to an endpoint.

The twist is the field names have space between them. e.g First Name.

I am using tExtracJson and tFileOutputdelimited. This component doesnt accept space.

Can someone suggest how to resolve this issue without having to replace the space with no space or underscore.

 

Thanks

Labels (4)
12 Replies
Anonymous
Not applicable
Author

You cannot put spaces in headers because they are essentially variables. This can be pain sometimes. However, there is an easy solution (hack) for this. You have a process where you are moving data from JSON to CSV. I assume that works. What you need to do is change the config of the file output component to NOT include the header and to "Append". Then before this process(subjob) takes place, create another subjob with the sole purpose of writing the header. Use a tFixedFlowInput with one row and hard code your header names. You can have whatever you want. Connect this to a file output component (not the one you are already using) and make sure "Append" is unticked and"Include Header" is unticked. 

 

What this does is write a single row at the beginning of a new file....this is your header row. You then append to that file with the flow of data you already have.

0683p000009LsBB.png

 

 

Anonymous
Not applicable
Author

Hi,

I tried the approach. It populates the header. But I need the csv file to be generated like this:

 

Field1,Field2,Field3,Field4, etc

Currently I am getting it as

Field1

Field2

Field3

Field4

Screen shot of my setting is attached. I tried various approaches and apart from hardcoding, nothing seems to work.

 


pic.zip
Anonymous
Not applicable
Author

Got the solution. Thanks