Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to use and "If" statement with Set Analysis

Any ideas on why this expression is not working for me? Thanks!

Note: vSA_IgnoreSKUToggle and vSA_IgnoreBranchPlantToggle are variables set by users.

=
if
(
vSA_IgnoreSKUToggle = ' ' AND vSA_IgnoreBranchPlantToggle = ' ',
sum(
{$<Branch_Plant = , SKU = >}
Inventory_Snapshot.On_Hand_Saleable_Quantity)
,0
)

3 Replies
erichshiino
Partner - Master
Partner - Master

What kind of results did you get?

I understand that if your variables are a single space ' ' you make set analysis ignoring selections in two fields, right?

Maybe you should test your variables for blanks '' or even nulls ( isnull(vSA_IgnoreSKUToggle))

Maybe you should evaluate your variable before testing it $(vSA_IgnoreSKUToggle) = ''

Not applicable
Author

I counted the length of the variables and that is working for me now. Thanks anyway.

if


(
//// 1 = Global, 2 = Selected
len(vSA_IgnoreBranchPlantToggle) =1 AND len(vSA_IgnoreSKUToggle)= 2 ,
sum(
$(vSA_GlobalLocationsandSelectedProducts)

Inventory_Snapshot.On_Hand_Saleable_Quantity)





neetu_singh
Partner - Creator III
Partner - Creator III

Hi,

you can use your expression like this:

=sum(
{$<Branch_Plant = , SKU = >}if
(
vSA_IgnoreSKUToggle = ' ' AND vSA_IgnoreBranchPlantToggle = ' ',
Inventory_Snapshot.On_Hand_Saleable_Quantity)
,0
)

it will work, if not then let me know

Regards

Neetu Singh