Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Highlighted
Dano
New Contributor II

How to accept NULL values in parameter?

Hi,

I have a variable with parameters like following:

vMyVariable

=Sum({$<[Condition1] = {'abc'},[Condition2] = {$1}>}$2)

now, in one instance I would like to call this variable and make it ignore Condition2 (accept also not existing values).

I could write set analysis like this:

=Sum({$<[Condition1] = {'yes'},[Condition2] = >}Sales) that would do the trick, but I cannot figure out how to use it with parameter.

vMyVariable(,Sales) returns 0

vMyVariable(*,Sales) would take only fields with any value in Condition2 and I will be missing values where Condition2 is NULL.

(Condition2 is in dimension table and doesn't exists for some lines)

Do you know any of any way how to call this parameter?

1 Solution

Accepted Solutions
andrey_krylov
Valued Contributor

Re: How to accept NULL values in parameter?

Try this expression for a variable

Sum({$<[Condition1] = {'abc'},[Condition2] = $1>} $2)

and pass a whitespase as a parameter

vMyVariable( ,Sales) or vMyVariable({'abc'},Sales)

View solution in original post

3 Replies
andrey_krylov
Valued Contributor

Re: How to accept NULL values in parameter?

Try this expression for a variable

Sum({$<[Condition1] = {'abc'},[Condition2] = $1>} $2)

and pass a whitespase as a parameter

vMyVariable( ,Sales) or vMyVariable({'abc'},Sales)

View solution in original post

Re: How to accept NULL values in parameter?

May be try this

=Sum({$<[Condition1] = {'abc'},[Condition2] = $1>}$2)


and then pass value like this for ignoring condition2

vMyVariable({*},Sales)

for other conditions, may be this

vMyVariable({">10"},Sales)

Dano
New Contributor II

Re: How to accept NULL values in parameter?

putting $1 without {} and calling vMyVariable( ,Sales) solved the issue.

Thanks