Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Novarbis
Contributor II
Contributor II

Syntax for filter and If() statement

Hi all,

I am creating a dynamic text box based on filters on product and country. 

I want something like 'You are now looking at sales for "product" from "country".'

The filter then decides which country and product is mentioned in the text box.

My problem is, that if all product are shown (hence, there is no filter on "product"), then I don't know the filter syntax.

I tried something like the following

If(Product = null(), 'all products', Product),  but the "null()" is incorrect. So my question is, what is the syntax for a non-filtered filter? 

There are too many products to mention them all in a combined if-statement.

Thanks!

Best
Tobias

Labels (4)
1 Solution

Accepted Solutions
sunny_talwar

You can try this

If(Len(Trim(Product)) = 0, 'all products', Product)

or

If(IsNull(Product)), 'all products', Product) 

or

If(GetSelectCount(Product)) = 0, 'all products', Product)

 

View solution in original post

2 Replies
sunny_talwar

You can try this

If(Len(Trim(Product)) = 0, 'all products', Product)

or

If(IsNull(Product)), 'all products', Product) 

or

If(GetSelectCount(Product)) = 0, 'all products', Product)

 

Novarbis
Contributor II
Contributor II
Author

Thanks Sunny!

Solution number 2 worked perfectly!

BR

Tobias