Categories
- All Categories
- 168 Oracle Analytics News
- 34 Oracle Analytics Videos
- 14.8K Oracle Analytics Forums
- 5.8K Oracle Analytics Idea Labs
- Oracle Analytics User Groups
- 56 Oracle Analytics Trainings
- 13 Oracle Analytics Data Visualizations Challenge
- 4 Oracle Analytics Career
- 2 Oracle Analytics Industry
- Find Partners
- For Partners
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.
0 -
Sure Christian. Thanks for your input.
Regards,
Chethana
0 -
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
0 -
Thank you Brian.
0