Categories
- All Categories
- Oracle Analytics and AI Learning Hub
- 44 Oracle Analytics and AI Sharing Center
- 20 Oracle Analytics and AI Lounge
- 278 Oracle Analytics and AI News
- 56 Oracle Analytics and AI Videos
- 16.2K Oracle Analytics and AI Forums
- 6.4K Oracle Analytics and AI Labs
- Oracle Analytics and AI User Groups
- 103 Oracle Analytics and AI Trainings
- 20 Oracle Analytics and AI Challenge
- 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