Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
DY94
Contributor II
Contributor II

Using If Condition in Tmap

Dear Community,

 

I need to do this condition in Tmap:

if row.int_rate == 3

then row.int_rate = row.int_spread + row.taux_base

else

row.int_rate = row.int_rate

 

Thank you.

1 Solution

Accepted Solutions
kakooo16
Creator
Creator

!Relational.ISNULL(row3.int_rate) && (row3.int_rate == 3) ?row3.int_spread + row3.taux_base : row3.int_rate 

View solution in original post

7 Replies
kakooo16
Creator
Creator

!Relational.ISNULL(row3.int_rate) && (row3.int_rate == 3) ?row3.int_spread + row3.taux_base : row3.int_rate 

DY94
Contributor II
Contributor II
Author

Hi kakooo16,

Thank you for answer !

I got just one error in this line " row.int_rate = row.int_rate "

its says " syntax error on token '=' "

 

Thanks.

kakooo16
Creator
Creator

 

here is a screenshot 0695b00000N1ZZ5AAN.png

DY94
Contributor II
Contributor II
Author

Thanks ! It works.

DY94
Contributor II
Contributor II
Author

Hi @not specified not specified​,

 

The code works fine but i got " NullPointerException" Error !!

 

this is my final Code:

 

(Float)

(

(row4.INT_RATE_TYPE== 3) && (!Relational.ISNULL(row4.INT_RATE_TYPE) ) ? row4.INTEREST_SPREAD + row4.TAUX_BASE : row4.INTEREST_RATE

) 

 

Thanks.

kakooo16
Creator
Creator

try this

 

(

(row4.INT_RATE_TYPE== 3) && (!Relational.ISNULL(row4.INT_RATE_TYPE) && (!Relational.ISNULL(row4.INTEREST_SPREAD ) && (!Relational.ISNULL(row4.TAUX_BASE ) ) ? row4.INTEREST_SPREAD + row4.TAUX_BASE : row4.INTEREST_RATE

) 

DY94
Contributor II
Contributor II
Author

Thank you @not specified not specified​