Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum of Sales for Null Id

Hello everyone,

I have a table with ProductId and respective sales.Requirement is to sum(Sales) where productId is null.I have write following condition but it didnt work please if anyone has any idea please share with me.

Syntax

Sum({<ProductId={-}>}Sales)

I know,I have missed something but I didnt get what it is.

Table is in following snapshot

t1.png

1 Solution

Accepted Solutions
amit_saini
Master III
Master III

Bhawna,

Try this:

sum( if(isnull(ProductId), Sales))

Thanks,

AS

View solution in original post

3 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Try

Sum({<ProductId-={'*'}>}Sales)

or

Sum({<ProductId={"=IsNull(ProductId)"}>}Sales)


Thanks

amit_saini
Master III
Master III

Bhawna,

Try this:

sum( if(isnull(ProductId), Sales))

Thanks,

AS

PradeepReddy
Specialist II
Specialist II

Method-1

In Script

NULLASVALUE ProductID,Sales...

Set NullValue = 'PN' ;

Load ProductID,Sales from Sales_Tab;

In Expression: Sum({<ProductID={'PN'}>}Sales)

Method-2

sum( if(isnull(ProductId), Sales))