At first you should create simple query with simple db table, some values and requested result that clearly shows your problem.
Part 1: I want replace null value with 0
To change NULL into some value you can use NVL()
function. Documentation says: The NVL expression returns different results, depending on whether its first argument evaluates to NULL.
Examples:
SELECT fld, NVL(fld, 0) FROM ...
Part 2: and if not null i want to count the data
SELECT COUNT(*) FROM ... WHERE fld IS NOT NULL