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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Export CSV each column of data row

Hi all,

I have a sample data:
Id, col1, col2 col3

1, value1, value2, value3

 

Now I want to check if any value of any column is matched with an other DB table shema by tSchemaComplianceCheck.

And I want to export the id, the name and the value of error column and error message.

Example:
"value1" is an invalid value because it's not an integer (the target schema is integer type), i want export a CSV row:

id, colName, value, errorMessage

1, col1, value1, Not an integer.

 

And if value of col2 is invalid too, then export a new CSV row append to the row exported before.

 

Please give some suggestion. Thanks all.

Labels (2)
1 Reply
Anonymous
Not applicable
Author

Hello
The reject link of tSchemaComplianceCheck will has the output like

0683p000009LvUQ.png

after tSchemaComplianceCheck, you can use a tExtractDelimitedFields to extract column name and error message from the errorMessage column, eg:

tfileinputdelimited-main-tSchemaComplianceCheck--reject--tExtractDelimitedFields-row2-tMap-->tfileoutputdelimited

 

on tMap: set the expression of column_value column as:

column_name.equals("c1")?row2.c1: (column_name.equals("c2")?row2.c2: (column_name.equals("c3")?row2.c3:row2.id))

 

Regards

Shong