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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
shane_spencer
Specialist
Specialist

Created an IF statement by concat'ing records in a table

I wanted to create an IF statement by concat'ing many rows in  a Table. See attached qvd

Field [Validation_Compare_String] is the If statement

Field [Validation_Reference] is the result

I've almost got this to work but I need to close the Statement with the required number of closing brackets i.e. )))))))

IFSTATEMENT:
NoConcatenate
Replace LOAD
concat('If('&Validation_Compare_String&','&Validation_Reference&',') &')' As [Validation_If_Statement]
Resident VALIDATIONRULES;

STORE IFSTATEMENT into IFSTATEMENT.qvd (qvd);

Any ideas how to do this?

1 Solution

Accepted Solutions
shane_spencer
Specialist
Specialist
Author

I added another column to the data containing a closing bracket. Then concat'd this up: concat( 'If([AUTOREVIEW_REFERENCE_new]='&Validation_Reference&','&Validation_Result3&',' ,'',Validation_Reference) & Concat(Validation_Closing_Braket) As [Tax_Code_If_Statement],

View solution in original post

2 Replies
alex00321
Creator II
Creator II

Can we change the way of this question, I checked the formula and it's like has so many ifs which makes it impossible to debug. Can we split the IFs? thanks!

shane_spencer
Specialist
Specialist
Author

I added another column to the data containing a closing bracket. Then concat'd this up: concat( 'If([AUTOREVIEW_REFERENCE_new]='&Validation_Reference&','&Validation_Result3&',' ,'',Validation_Reference) & Concat(Validation_Closing_Braket) As [Tax_Code_If_Statement],