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: 
stephbzr
Contributor III
Contributor III

if without else in tMap

Hello, I'm looking to solve the case below with a code in the tMap component only, do you have an idea? I know how to solve it with a tJavaRow (because I can do an if without the else), but if someone has the solution in a tMap, I'm interested 

 

My code :

0695b00000StE2XAAV.png 

Result :

0695b00000StE28AAF.png 

The problem with a tMap condition is that I have to put an else condition, so I have to put "", how to do ?

 

Thank you for your help.

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi

tMap does not support if statement without else..., I don't know how the sequence id comes from in your case, my idea is to store the current sequence id to a global variable before tMap, and use this variable in the else part on tMap, eg:

output_data.date.equals("070")?String.valueOf(name_table.id_column++):(Integer)globalMap.get("varName")

 

Regards

Shong

 

 

View solution in original post

1 Reply
Anonymous
Not applicable

Hi

tMap does not support if statement without else..., I don't know how the sequence id comes from in your case, my idea is to store the current sequence id to a global variable before tMap, and use this variable in the else part on tMap, eg:

output_data.date.equals("070")?String.valueOf(name_table.id_column++):(Integer)globalMap.get("varName")

 

Regards

Shong