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

Value is 1, if it have value , Value is NULL, it have no value - tmap expression helppppp !!!!

Dear Team,

 

I have a following condition 

Field name : major

Condition:

Value is 1, if it have value
Value is NULL, it have no value

 

Can someone help me out - how to write expression syntax for this ?

 

Thanks,

Prabhakaran.R

Labels (2)
1 Solution

Accepted Solutions
manodwhb
Champion II
Champion II

@prabuj27 , check the below example.

0683p000009M4OB.png0683p000009M4XC.png

View solution in original post

12 Replies
manodwhb
Champion II
Champion II

@prabuj27 ,if the field data type is sting then you can use the below way.

 

("1").equals(row3.newColumn)?row3.newColumn:null

manodwhb
Champion II
Champion II

@prabuj27  if it is integer the use the below way.

 

row3.newColumn==1?row3.newColumn:null

bhagyarekha
Creator II
Creator II

Hi

may i know the 'value' means what data it holds or give us sample data,and datatype you use in your job

regards

rekha

Anonymous
Not applicable
Author

@bhagyarekha it's a integer. Could you let me know the expression syntax what i can write to get the result ?
Anonymous
Not applicable
Author

@bhagyarekha it's a integer. Could you let me know the expression syntax what i can write to get the result ?

bhagyarekha
Creator II
Creator II

Hi

your input is

major (int)                            output (String)

10                                           1

20                                          1

0                                           null

30                                         1

40                                          1 

 

find attachment

regards

rekha

 

 


Capture.JPG
manodwhb
Champion II
Champion II

@prabuj27 , for integer,use the below way.

 

row3.newColumn==1?row3.newColumn:null

bhagyarekha
Creator II
Creator II

hi

just confirmation

input                            output

major(int)                        x(string)

10                                     1

0                                       null

20                                     1

30                                     1

 

 

like this you are asking?

Anonymous
Not applicable
Author

Alright Guys, It's not working, throwing null-exception, I changed the data type into string on source as well as in the destination.

 

Here is the clear Explanation

 

Only 1 and 'empty records' are in the source data -> needed 1 as 1 and  empty record as null  ---- destination

 

'that's it'

 

i changed the data type as string in both source and destination

 

Data_in ( Source) 

Major_spill - Field name                       

1

empty record

1

 

Destination ( Required )

Major - Field name

1

NULL

 

give me a expression syntax for this ? Hope you all got it 

 

Thanks & Regards,

Prabhakaran. R