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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Nested if Calculation

Hi All,

I am trying to do Nested IF in Tmap but due to some reason its throwing Error. How to fix this issue in tmap here is my condition and 
error
Var.AusValidNo ==true && Var.LenforAusValidNo = 9 ? row3.cli_mobile:
Var.AusValidNo ==false && Var.LenforAusValidNo <9 ? "":
Var.ValidLandLine==true && Var.LenforAusValidNo = 9?"":
Var.ValidLandLine==false && Var.LenforAusValidNo <9?"":row3.cli_mobile 
0683p000009MG2y.png

Labels (2)
3 Replies
TRF
Champion II
Champion II

You need to change "=" by "==" for evaluation.
However, you cannot mixe different datatypes in ternary evaluation (you have boolean, string and integer)
Anonymous
Not applicable
Author

I tried to use like this at that time its throwing multiple error  "=="
if cant use multiple datatype for filtering condition using ternary operator in tmap
then how can i write the condition and bring my desired output
TRF
Champion II
Champion II

How are defined the variables? Can your share the tMap?
Independently of my previous post (I'm not completly sure) you should write like this
(Var.AusValidNo && Var.LenforAusValidNo == 9) ? row3.cli_mobile :[size=1][font=Verdana, Helvetica, Arial, sans-serif][/font][/size]
   (!Var.AusValidNo && Var.LenforAusValidNo < 9) ? "" :[size=1][font=Verdana, Helvetica, Arial, sans-serif][/font][/size]
      (Var.ValidLandLine && Var.LenforAusValidNo == 9) ? "" :[size=1][font=Verdana, Helvetica, Arial, sans-serif][/font][/size]
         (!Var.ValidLandLine && Var.LenforAusValidNo < 9) ? "" : row3.cli_mobile

What appens now?