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

Count string variables - broken down by null and non null

Started by ELISAMENDES, 11 May 2015 09:34:18 AM

Previous topic - Next topic

ELISAMENDES

Hi Gurus,


I've a list with string values, as an example:
Country   First Name   Last Name   Prefered store   Age
A   Jon   F.   123                                                    18
A   Daniel   F.   125   
B   James   D.                       31
B   Ana   F.   12                                                     25

I would like to group by country and count the variables with null and non null fields.

So contry A will have

Country   Minimum profile by country   First Name   Last Name   Prefered store   Age   Total
A   Null                                     0                       0                       2                      1   3
A   Total                                     2                       2                       2                      2   8
A   % Null                                     0%                       0%                      100%                      50%   38%

How can I count string values? broken down by null and non null.

Thanks
Elisa

Lynn

You could try creating expressions in the query to count things. The expression below should return the number of rows where the age is null. Set the aggregation to sum.


case
  when [Age] is null then 1
  else 0
end