Author Topic: Issue with hiding null totals in subtotal & grantotal crosstab  (Read 446 times)

Offline krishdw85

  • Full Member
  • ***
  • Posts: 49
  • Forum Citizenship: +0/-4
Hi Experts,

Pl guide me!
How to handle null records in totaling.

I have a two statements in two dimensions like:

case
     when [XYZ]. [Line of Business].[Line of Business Desc]='Retail'
    then [XYZ].[New/Used].[New/Used Desc]
end

case
    when[XYZ]..[Line of Business].[Line of Business Desc]='SmartLease'   
  then  [XYZ]..[Line of Business].[Line of Business Desc]
end

Data is looks like this in cross tab output:::

Applications#  20100813    20100814
new                 171             200
used                  59             310
                       110                10
subtotal           340            420
smartlease        20              30
                        100             40
subtotal           120             70
grandtotal       460            490

I want to ignore   **                     110                10**  &                         100             40 these columns and and want to ignore them in totalling also.

Your help is really appreciated.
Thank you so much!!

Offline krishdw85

  • Full Member
  • ***
  • Posts: 49
  • Forum Citizenship: +0/-4
Re: Issue with hiding null totals in subtotal & grantotal crosstab
« Reply #1 on: 06 Jan 2012 01:10:14 am »
your advices are really appreciated

Offline MFGF

  • Never knowingly correct
  • Super Moderator
  • Statesman
  • ******
  • Posts: 3,112
  • Forum Citizenship: +153/-3
  • Cognos Software Muppet
Re: Issue with hiding null totals in subtotal & grantotal crosstab
« Reply #2 on: 06 Jan 2012 02:49:52 am »
If you want the null values to be removed, add a detail filter to your report:

[XYZ].[Line of Business].[Line of Business Desc] is not null

Regards,

MF.
Meep!

Offline krishdw85

  • Full Member
  • ***
  • Posts: 49
  • Forum Citizenship: +0/-4
Re: Issue with hiding null totals in subtotal & grantotal crosstab
« Reply #3 on: 06 Jan 2012 03:35:32 am »
I did this filter , and tested also.No result. This will hide in LOB , not in new used.
If we keep two filters like LOB is not null and Newused is not null then report will display blank page.

Why it is not working is::

Null records are coming in two dimensions i..e, New , and line of business.
And hence both the condition satisfies and the report coming is blank.

And i tried with Boolean variable also same result.

Offline krishdw85

  • Full Member
  • ***
  • Posts: 49
  • Forum Citizenship: +0/-4
Re: Issue with hiding null totals in subtotal & grantotal crosstab
« Reply #4 on: 07 Jan 2012 04:52:19 am »
Help needed!!!

Online blom0344

  • BI Architect
  • Global Moderator
  • Statesman
  • *****
  • Posts: 1,747
  • Forum Citizenship: +60/-2
  • Assess what you need instead of what you want
    • Reasult b.v.
Re: Issue with hiding null totals in subtotal & grantotal crosstab
« Reply #5 on: 07 Jan 2012 03:39:34 pm »
This can be easily solved by splitting the original query into a  2-set and applying a union :

Query1:

Fetch  [XYZ].[New/Used].[New/Used Desc]
with detail filter  [XYZ]. [Line of Business].[Line of Business Desc]='Retail'

Query2:

Fetch  [XYZ]. [Line of Business].[Line of Business Desc]
with detail filter  [XYZ]. [Line of Business].[Line of Business Desc]='Smartlease'

This allows for creating the proper filter for each set

The resulting Union query can then be used as input for the list/crosstab
Oracle9i,DB2/AS400/Busobj 6.5/Powercenter7/Cognos8 /
SSIS 2005 / SQL SERVER 2005 /PowerDesigner 12.5/15

Offline krishdw85

  • Full Member
  • ***
  • Posts: 49
  • Forum Citizenship: +0/-4
Re: Issue with hiding null totals in subtotal & grantotal crosstab
« Reply #6 on: 09 Jan 2012 12:40:46 am »
Hi ,
Thanks for your help.

I ll make a try .
In the meanwhile may i know u r mail address so that i cans end u some screenshots with an example.

krish.dw85@gmail.com is my id.

Offline krishdw85

  • Full Member
  • ***
  • Posts: 49
  • Forum Citizenship: +0/-4
Re: Issue with hiding null totals in subtotal & grantotal crosstab
« Reply #7 on: 09 Jan 2012 12:57:41 am »
Hi ,

I done with your solution which u provided....but not getting exact data.

am unable to paste the screenshot, may i know u r mail id so that i ll send XML.

Thanks for the reply.

Online blom0344

  • BI Architect
  • Global Moderator
  • Statesman
  • *****
  • Posts: 1,747
  • Forum Citizenship: +60/-2
  • Assess what you need instead of what you want
    • Reasult b.v.
Re: Issue with hiding null totals in subtotal & grantotal crosstab
« Reply #8 on: 09 Jan 2012 01:04:18 am »
The cognoise forum has an option to send pm's (private messages) through the board. This is a better option than posting email addresses out into the open.

The xml has not much value since I do not have your package definition as well. Perhaps you better describe what does not work for you..
Oracle9i,DB2/AS400/Busobj 6.5/Powercenter7/Cognos8 /
SSIS 2005 / SQL SERVER 2005 /PowerDesigner 12.5/15

Offline krishdw85

  • Full Member
  • ***
  • Posts: 49
  • Forum Citizenship: +0/-4
Re: Issue with hiding null totals in subtotal & grantotal crosstab
« Reply #9 on: 09 Jan 2012 01:09:57 am »
After unioning...am seeing both the data for line of business i.e., retail & smatlease. And all the subtotals , grandtotals data is same.


Offline krishdw85

  • Full Member
  • ***
  • Posts: 49
  • Forum Citizenship: +0/-4
Re: Issue with hiding null totals in subtotal & grantotal crosstab
« Reply #10 on: 09 Jan 2012 01:20:36 am »
Am doing report in crosstab.

Online blom0344

  • BI Architect
  • Global Moderator
  • Statesman
  • *****
  • Posts: 1,747
  • Forum Citizenship: +60/-2
  • Assess what you need instead of what you want
    • Reasult b.v.
Re: Issue with hiding null totals in subtotal & grantotal crosstab
« Reply #11 on: 09 Jan 2012 01:30:07 am »
Just  a tip : You can modify your own post, so you do not need to create another entry to add comment to an earlier post.

Your last 2 posts really give no clue what has improved and what still needs to be fixed
Oracle9i,DB2/AS400/Busobj 6.5/Powercenter7/Cognos8 /
SSIS 2005 / SQL SERVER 2005 /PowerDesigner 12.5/15

Offline krishdw85

  • Full Member
  • ***
  • Posts: 49
  • Forum Citizenship: +0/-4
Re: Issue with hiding null totals in subtotal & grantotal crosstab
« Reply #12 on: 09 Jan 2012 01:40:03 am »
Issue was not yet resolved with union also........still it is unable to ignore null values data in totalling.

Online blom0344

  • BI Architect
  • Global Moderator
  • Statesman
  • *****
  • Posts: 1,747
  • Forum Citizenship: +60/-2
  • Assess what you need instead of what you want
    • Reasult b.v.
Re: Issue with hiding null totals in subtotal & grantotal crosstab
« Reply #13 on: 09 Jan 2012 07:16:05 am »
Issue was not yet resolved with union also........still it is unable to ignore null values data in totalling.

What do you mean by ignore?  Each set within the union needs it own filter definition to make sure relevant data is fetched. Did you apply any filters?
Oracle9i,DB2/AS400/Busobj 6.5/Powercenter7/Cognos8 /
SSIS 2005 / SQL SERVER 2005 /PowerDesigner 12.5/15

Offline krishdw85

  • Full Member
  • ***
  • Posts: 49
  • Forum Citizenship: +0/-4
Re: Issue with hiding null totals in subtotal & grantotal crosstab
« Reply #14 on: 09 Jan 2012 07:26:08 am »
Thanks blom for your response.


finally i did it using nvl function..ie., nvl(lob,0) ...and filtered on nvl-retail & smartlease.

Thanks to cognoise & all.