Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
djbloiss
New Contributor III

When using a variable for expression, cannot pass string with comma

I am using a variable to save my expressions, so I can reuse them in multiple places and change them all easily.  So I have this one expression saved as a variable:

Sum({<$1, $2, $3>} [Actual Quantity])

that I then use in multiple places.  here is a place that I call it and it works fine passing multiple arguments:

$(e_Cases($(vSO_Closed_Only), InternalSlsFlag={0}, Node1={'Diner Sales'}))

then I just used it here:

$(e_Cases($(vSO_Closed_Only), [Originating cl for order]={'D','P','B'}))

and it doesn't work.  Odd.  So I do some testing.  If I remove 2 of the 3 filters from the second argument, it then works. So this will work:

$(e_Cases($(vSO_Closed_Only), [Originating cl for order]={'D'}))

or this:

$(e_Cases($(vSO_Closed_Only), [Originating cl for order]={'B'}))

How can I get it so all 3 can be passed?

Tags (1)
2 Replies
Highlighted

Re: When using a variable for expression, cannot pass string with comma

Highlighted
MVP & Luminary
MVP & Luminary

Re: When using a variable for expression, cannot pass string with comma

Commas within variable-parameters are always a problem which could be partly solved with various workarounds like hinted from Sunny. In your case you don't need mandatory the commas because you could replace your value-list with a search-string like (D|P|B).

- Marcus