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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Null value.

Hi

I have value 1 and - for a dimension called flag. The - is equivalent to null which is the result of left join I have performed. How do I check the - in set analysis to create an expression?

Appreciate any help around this. I read several discussions related to this but nothing helped.

Thanks

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Consider you have below data....

Load * Inline

[

  Customer, Sales, Flag

  A, 10, -

  B, 100, 1

  C, 50,

  D, 40, 1

  E, 200,

];

In Text Box, use below expressions.

=SUM(Sales)

Will give you total Sales

=SUM({<Flag = {"=Len(Trim(Replace(Flag,'-','')))>0"}>}Sales)

Will give you SUM(Sales) where Flag is not Null or not -....

=SUM({<Flag = {"=Len(Trim(Replace(Flag,'-','')))=0"}>}Sales)

Will give you SUM(Sales) where Flag = null or -

View solution in original post

3 Replies
MK_QSL
MVP
MVP

What type of expression you want? Kindly elaborate little more !

Not applicable
Author

Expression I'm looking for is simple. To check the dimension for null value or - and sum the sales.

MK_QSL
MVP
MVP

Consider you have below data....

Load * Inline

[

  Customer, Sales, Flag

  A, 10, -

  B, 100, 1

  C, 50,

  D, 40, 1

  E, 200,

];

In Text Box, use below expressions.

=SUM(Sales)

Will give you total Sales

=SUM({<Flag = {"=Len(Trim(Replace(Flag,'-','')))>0"}>}Sales)

Will give you SUM(Sales) where Flag is not Null or not -....

=SUM({<Flag = {"=Len(Trim(Replace(Flag,'-','')))=0"}>}Sales)

Will give you SUM(Sales) where Flag = null or -