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

How to check if a column is not empty when another is not empty

Hello team,
Do you have an idea to help me please:
i import a file with multiple column.
Column 1 must have a value if the Column 2 is not empty
same for the Column 3, but column 2 and 3 are optional, the file can have only 1 column with value
i tried
(!Relational.ISNULL(row3.Level_2_cd) && !row3.Level_1_cd.equals("")) ==
(!Relational.ISNULL(row3.Level_3_cd) && !row3.Level_2_cd.equals(""))
but that report me an error due to the fact the column 1 is not empty
and that in a tmap
thanks for your help
Labels (2)
7 Replies
Anonymous
Not applicable
Author

Hi
First, where do you want to use this condition? What's your essential requirement to do this? To filter rows?
Regards,
Pedro
Anonymous
Not applicable
Author

i used this condition in a tmap
Anonymous
Not applicable
Author

here is a screenshot
Anonymous
Not applicable
Author

Hi
In fact, I don't understand your filtering rule.
Sorry.
Regards,
Pedro
Anonymous
Not applicable
Author

it's not easy to explain.
in the screenshot, on the left my imported file
on the right mut ouput file (out1) and rejected file (reject)
i will put in reject file all rows with an level_1_cd empty while level_2_cd full
Anonymous
Not applicable
Author

hello,
i found why, just an issue with my expression.
(!Relational.ISNULL(row3.Level_2_cd) && !row3.Level_1_cd.equals("")) && (!Relational.ISNULL(row3.Level_3_cd) && !row3.Level_2_cd.equals(""))
instead of
(!Relational.ISNULL(row3.Level_2_cd) && !row3.Level_1_cd.equals("")) == (!Relational.ISNULL(row3.Level_3_cd) && !row3.Level_2_cd.equals(""))
Sorry for your time
Anonymous
Not applicable
Author

Hi
Great! Glad to hear you have fixed it.
Regards,
Pedro