Oracle Analytics Cloud and Server

Products Banner

How to calculate number of rows in a table with value null

Received Response
71
Views
4
Comments

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