COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Tsunami on 20 Jul 2011 09:19:21 AM

Title: How to display null values
Post by: Tsunami on 20 Jul 2011 09:19:21 AM
Probably pretty simple BUT I'm trying to create a list of customers and sales.  However, the list is leaving off any customers without sales.  What do I have to do to have a full list of customers with and without sales?
Title: Re: How to display null values
Post by: Arsenal on 20 Jul 2011 10:04:17 AM
depends upon the join between customer dim table and sales fact table.
you'll need some sort of an outer join - depending on how you have arranged it in FM you may require a left or right outer join or maybe even a full outer join (PERFORMANCE WARNING!!!!)

also in RS you'll need to number format fact data items to have missing values replaced with NA or something
if it is null on the DB for no sales customers, you might have to try a coalesce around the fact data item expression
Title: Re: How to display null values
Post by: Lynn on 20 Jul 2011 10:51:03 AM
Another option to consider might be a union instead of an outer join.

Create a query from your customer table and add a data item for sales with an expression of zero.

Then query from your sales data with the exact same layout.

Union the two results together setting the sales data item aggregation to Total.

Can't say it will be faster than an outer join but it is another means of accomplishing the same thing.
Title: Re: How to display null values
Post by: nthacker on 19 Aug 2011 07:49:51 AM
You could also use a Query calculation to create a new column.  Use and If, or Case statement to convert the nulls to 0's then cut out the old column and use the new one.