Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Null value in set analysis

I would like to know the sales values when Top BU is null. I tried the below expression but it is not working.

sum({<[Top BU]={"$(=IsNull([Top BU]))"}>}Sales).

I would like to have your suggestions to correct my expression.

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I think Anil's answer is correct. Note the "-" after $.  See also

NULL handling in QlikView

-Rob

View solution in original post

12 Replies
sushil353
Master II
Master II

Try this:

sum({<[Top BU]={""}>}Sales)

Anonymous
Not applicable
Author

Not Working...

Anil_Babu_Samineni

May be using this

=Sum({$-<[Top BU]={'*'}>} Sales)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

I think above will give sales where top bu is not null. But I am looking for Sales when Top BU is NULL.

Anil_Babu_Samineni

Would you share sample data?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Top BUSales
SEC625000
-1000000
EM164000
-262400
-1000000
-55200
-250000
API115000
-138000
API291666.66
-350000
API0.83
-1

When I exported, null values are replaced with '-'.

MK_QSL
MVP
MVP

Data:

Load

  If(IsNull([Top BU]) or Len(Trim(Replace([Top BU],'-','')))=0, Null(), [Top BU]) as [Top BU],

  If(IsNull([Top BU]) or Len(Trim(Replace([Top BU],'-','')))=0, 1,0) as TopBUNullFlag,

  Sales

Inline

[

  Top BU, Sales

  SEC, 625000

  -, 1000000

  EM, 164000

  -, 262400

  -, 1000000

  -, 55200

  -, 250000

  API, 115000

  -, 138000

  API, 291666.66

  -, 350000

  API, 0.83

  -, 1

];

Now use as below

=SUM({<TopBUNullFlag = {1}>}Sales)

MK_QSL
MVP
MVP

If you don't want to change anything in script then use as below..

=SUM({1-<[Top BU] = {'*'}>}Sales)

Anil_Babu_Samineni

For me this is working

Sum({<Top -= {"-"}>}[BU Sales]) // - and = is there

Capture.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful