If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Expression to count even if null

Started by amoslade, 04 May 2017 07:49:01 AM

Previous topic - Next topic

amoslade

I have a graph report I am creating.  I am trying to count the number of work orders assigned to individual technicians.  We have some work orders unassigned and I want those to show on the graph as well.  Here is the count statement I am using and I am wondering how to change it so null values will be included.

count ([EVT_CODE] FOR [EVT_PERSON], [Location])

Thanks for any advice!

Lynn

Quote from: amoslade on 04 May 2017 07:49:01 AM
I have a graph report I am creating.  I am trying to count the number of work orders assigned to individual technicians.  We have some work orders unassigned and I want those to show on the graph as well.  Here is the count statement I am using and I am wondering how to change it so null values will be included.

count ([EVT_CODE] FOR [EVT_PERSON], [Location])

Thanks for any advice!

You can try using a coalesce function to replace the null value with text that can then be counted by the count function.

Quote
coalesce ( expression_list )

Returns the first non-null argument (or null if all arguments are null). Requires one or more arguments in "expression_list".


coalesce ( [EVT_PERSON], 'Unassigned' )


amoslade