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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] empty string to null for all string fields

I am working with data many hundreds of fields wide.  For every string field I need to convert empty string "" to null.  I can do this field by field with a tMap or tReplace component but it is tedious to set the transformation for each field when there are hundreds of them.
Is there a way to do this where I don't need to specify each field.  Like a "perform this transformation for all fields" capability?
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

That works.  I found that I needed to use advanced mode and replace with empty string rather then null.
pattern:  "\"\""
replace: ""
but I still need to get the field broken back out by schema.  In writing the file out and reading it back in with schema I found that just the defaults of the tFileOutputDelimited component would also remove the "".  So I can just read the file, write it out, and read it back in.  

View solution in original post

2 Replies
Anonymous
Not applicable
Author

Hi,
Have you tried to useTalendHelpCenter:tFileInputFullRow-->tReplace to replace all your empty string "" to null?
tFileInputFullRow can a file and reads it row by row and sends complete rows as defined in the Schema to the next Job component.
Best regards
Sabrina
Anonymous
Not applicable
Author

That works.  I found that I needed to use advanced mode and replace with empty string rather then null.
pattern:  "\"\""
replace: ""
but I still need to get the field broken back out by schema.  In writing the file out and reading it back in with schema I found that just the defaults of the tFileOutputDelimited component would also remove the "".  So I can just read the file, write it out, and read it back in.