Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Tommmy
Contributor III
Contributor III

Null formula - error in expression

Hi experts

the following formula is incorrect, the "isNull" seems not work. Any ideas?

sum({<isNull[Cost Center], [ Year]=, [ Month]=>} [Costs ])

Labels (4)
1 Solution

Accepted Solutions
Andrei_Cusnir
Specialist
Specialist

Hello,

 

Perhaps you can try: Sum({$-<[Cost Center]-={"''"}>}[Costs])

 

Outcome:

 

Value: 300 since it is the only value where Cost Center is null

 

I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate in details by providing additional information. However, if it has helped you resolve the issue, addressed your concerns or at least pointed you in the right direction, please mark it as Accepted Solution to give further visibility to other community members. 

Help users find answers! Don't forget to mark a solution that worked for you! 🙂

View solution in original post

5 Replies
Lakshminarayanan_J

@Tommmy 

Kindly post the sample data for reference .

Lakshminarayanan J
To help users find verified answers, please don't forget to use the "Accept as Solution" button
BrunPierre
Master
Master

It's possible you are not having exactly null in the [Cost Center] field, maybe a blank. So try these

sum({<[Cost Center]-={"''"}, [ Year]=, [ Month]=>} [Costs ])

OR

sum({<[Cost Center]-={"'-'", [ Year]=, [ Month]=>} [Costs ])

 

Tommmy
Contributor III
Contributor III
Author

Thanks Peter

But I need the "opposite" side. I have to calculate the value for cost centers without a "value".

The following code is not working:

sum({<[Cost Center]={"''"}, [ Year]=, [ Month]=>} [Costs ])

OR

sum({<[Cost Center]={"'-'", [ Year]=, [ Month]=>} [Costs ])

 

 

Andrei_Cusnir
Specialist
Specialist

Hello,

 

Perhaps you can try: Sum({$-<[Cost Center]-={"''"}>}[Costs])

 

Outcome:

 

Value: 300 since it is the only value where Cost Center is null

 

I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate in details by providing additional information. However, if it has helped you resolve the issue, addressed your concerns or at least pointed you in the right direction, please mark it as Accepted Solution to give further visibility to other community members. 

Help users find answers! Don't forget to mark a solution that worked for you! 🙂