Oracle Analytics Cloud and Server

How to calculate number of rows in a table with value null
Summary
How to calculate number of rows in a table with value null
Content
I have a laptop table with n no. of records in it. There are both active and inactive laptops in this table.
In OAC visualization, my requirement is to show number of active and inactive laptops present in the above table.
For all active laptops, the field Laptop_Name is not null and it can be found as count(Laptop_Name) and gives correct count.
However, for inactive laptops, the field Laptop_Name is null and thus count(Laptop_Name) would give zero and is incorrect. In OAC how do I create this calculated measure? Is there an inbuilt function that exists in OAC to calculate count(Laptop_Name) when Laptop_Name=null?, so that, it returns count(*)
Answers
-
You have to count something else. You can't count null. Like COUNT(Laptop_id) where laptop_name is null.
-
Sure Christian. Thanks for your input.
Regards,
Chethana
-
Chethana,
I would try and populate your null values with an "inactive" value through a data flow or data prep case statement to handle that count for you.
Brian
-
Thank you Brian.