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: 
markgraham123
Specialist
Specialist

Nested If Statement

Hi, I was trying to do a nested if  statement,

Where if the filed "Name"is null and "Filter count" >1 then i wanna display the field "Dept"

Else "Name"

Can some pls look into this.

If(Len(Trim(Name))=0,Dept, If([Filter Count] > 1,  Dept, [Name])) as [New Column],

18 Replies
jonas_rezende
Specialist
Specialist

Hi, Mark Graham.

Exactly.

How mentioned in your first post.

Where if the filed "Name"is null and "Filter count" >1 then i wanna display the field "Dept"

Else "Name"

markgraham123
Specialist
Specialist
Author

Hi Jonas,

I'm really sorry.

Its like, if we encounter any of the Null or Filter count >1 , then "Dept" else name.

Its wokring with or statement, but the problem is, only for few records, i'm gretting both the name and Dept.

which is strange.

sunny_talwar

Can you share some sample data where it is not working?

MarcoWedel

another one:

If(IsNull(Name) or [Filter Count], Dept, Name) as [New Column]

hope this helps

regards

Marco

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

Try this

IF(LEN(Name) = 0 OR ISNULL(Name) AND count([Filter Count]) > 1, Dept, Name) AS [New Col]

sunilkumarqv
Specialist II
Specialist II

try this

IF(Isnull(Name) or Filter count" >1 ,Dept,Name)  as [New Column]


or


IF(Isnull(Name) ,IF( Filter count" >1 ,Dept,Name))  as [New Column]

markgraham123
Specialist
Specialist
Author

Thanq sunil.

all the solutions worked.

markgraham123
Specialist
Specialist
Author

Thanq Gabriel.

markgraham123
Specialist
Specialist
Author

Thanq Marco.