Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in BI by (17.6k points)

I am just starting out with Tableau and have a question.

I have a star schema data warehouse with a fact table containing an "Amount", joined to a dimension containing "Event types"

Two event Types are "Settled" and "Cancelled"

I want to create a calculated measure in Tableau "Net Amount" which is the difference between the sum of Settled and Cancelled.

How do I do that?

I tried

SUM(IIF(Event_type_name = "Settled",Amount,0))-SUM(IIF(Event_type_name = "Cancelled",Amount,0))

but it returns a blank string 

1 Answer

0 votes
by (22.5k points)
edited by

Use ZN Function for converting null to zero

ZN function is a last logical function, and it has variations ISNULL and IFNULL

If a function is null it will return zero value

 If you want to learn more about it Tableau, then go through this Tableau Training for more insights. 

Related questions

0 votes
1 answer
0 votes
1 answer
asked Jul 26, 2019 in BI by Vaibhav Ameta (17.6k points)
0 votes
1 answer
asked Oct 10, 2020 in BI by dev_sk2311 (45k points)
0 votes
1 answer

Browse Categories

...