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

Min and Max check for each of columns in table and store exact failure for the column

Hi,

 

I am reading data from a table which contains 11 columns. For each of those 11 columns there are min and max rules that are defined. 

For each row in a table, I want to check for the min and max rules for each of those 11 columns. I need to track every rule failure. I performed this using tMap. But, the disadvantage here is that I do not exactly know which column failed with the validation. But, I get all the rejects with out information on each of the column failure. Please let me know if there is a way for doing the same ?

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Use the tMap variables ( the box in the middle of the tMap) and set up each of your variables (11 of them) to return true (pass) or false (fail). Then in your error output (I assume you have one) use some logic in your error message column (again, I assume you have one) to concatenate your errors. For example....

 

Var.column1Error ? "Column1 ("+row1.Column1 + ") is outside the min/max limits; " : "" +
Var.column2Error ? "Column2 ("+row1.Column2 + ") is outside the min/max limits; " : "" +
Var.column3Error ? "Column3 ("+row1.Column3 ") is outside the min/max limits; " : "" +
Var.column4Error ? "Column4 ("+row1.Column4 + ") is outside the min/max limits; " : "" +
Var.column5Error ? "Column5 ("+row1.Column5 + ") is outside the min/max limits; " : "" +
Var.column6Error ? "Column6 ("+row1.Column6 + ") is outside the min/max limits; " : "" +
Var.column7Error ? "Column7 ("+row1.Column7 + ") is outside the min/max limits; " : "" +
Var.column8Error ? "Column8 ("+row1.Column8 + ") is outside the min/max limits; " : "" +
Var.column9Error ? "Column9 ("+row1.Column9 + ") is outside the min/max limits; " : "" +
Var.column10Error ? "Column10 ("+row1.Column10 + ") is outside the min/max limits; " : "" +
Var.column11Error ? "Column11 ("+row1.Column11 + ") is outside the min/max limits; " : "" 

You can obviously add to this (it should be noted that I wrote this freehand with no checking, so there might be typos). Your error output would use filtering based on the tMap variables

View solution in original post

2 Replies
Anonymous
Not applicable
Author

Use the tMap variables ( the box in the middle of the tMap) and set up each of your variables (11 of them) to return true (pass) or false (fail). Then in your error output (I assume you have one) use some logic in your error message column (again, I assume you have one) to concatenate your errors. For example....

 

Var.column1Error ? "Column1 ("+row1.Column1 + ") is outside the min/max limits; " : "" +
Var.column2Error ? "Column2 ("+row1.Column2 + ") is outside the min/max limits; " : "" +
Var.column3Error ? "Column3 ("+row1.Column3 ") is outside the min/max limits; " : "" +
Var.column4Error ? "Column4 ("+row1.Column4 + ") is outside the min/max limits; " : "" +
Var.column5Error ? "Column5 ("+row1.Column5 + ") is outside the min/max limits; " : "" +
Var.column6Error ? "Column6 ("+row1.Column6 + ") is outside the min/max limits; " : "" +
Var.column7Error ? "Column7 ("+row1.Column7 + ") is outside the min/max limits; " : "" +
Var.column8Error ? "Column8 ("+row1.Column8 + ") is outside the min/max limits; " : "" +
Var.column9Error ? "Column9 ("+row1.Column9 + ") is outside the min/max limits; " : "" +
Var.column10Error ? "Column10 ("+row1.Column10 + ") is outside the min/max limits; " : "" +
Var.column11Error ? "Column11 ("+row1.Column11 + ") is outside the min/max limits; " : "" 

You can obviously add to this (it should be noted that I wrote this freehand with no checking, so there might be typos). Your error output would use filtering based on the tMap variables

Anonymous
Not applicable
Author

is there any another way to do this because im confused please provide a sample job please