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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Ternary operator in tMap

Hi,
Is there somebody to tell me why the following ternary expression doesn't works ?
Var.MNT_DR = (Map_In.SAADBC == "D") ? Map_In.SAAMNT : 0;
As shown on the debugger printsrceen, the field Map_In.SAADBC contains "D" so the test is true and the var.MNT_DR should be updated.
both Var.MNT_DR and Map_In.SAAMNT are float and SAADBC is defined as a String with a lenght of 1.
0683p000009MCEo.jpg
Labels (2)
2 Replies
Anonymous
Not applicable
Author

Hi,
Try this :
Var.MNT_DR = Map_In.SAADBC.equals("D") ? Map_In.SAAMNT : 0.0;
Anonymous
Not applicable
Author

That works ! Thanks a lot Maverick