Author Topic: How to get 0 if we don't have data  (Read 183 times)

Offline Sarayucog

  • Community Leader
  • *****
  • Posts: 115
  • Forum Citizenship: +1/-0
How to get 0 if we don't have data
« on: 03 Feb 2012 02:48:18 am »
Hi All,

I have report Month in Columns and 3 measures in Rows. For this Cross tab report I have data from Mar 2011 to Dec 2011. So its displaying data from Mar 2011 to Dec 2011, but here my requirement is I have to display Jan 2011 and Feb 2011 month values as 0s (Zeros) also.

It means in which month I won't have the data those months values should display with zeros, but in database we don't have any values for those months.

Can anyone suggest me on this.

Offline HalfBloodPrince

  • Community Leader
  • *****
  • Posts: 118
  • Forum Citizenship: +5/-0
Re: How to get 0 if we don't have data
« Reply #1 on: 03 Feb 2012 03:56:06 am »
Try to set format as Date and then set properties Missing Value Character and Zero Value Character to 0.

Offline Sarayucog

  • Community Leader
  • *****
  • Posts: 115
  • Forum Citizenship: +1/-0
Re: How to get 0 if we don't have data
« Reply #2 on: 03 Feb 2012 06:05:19 am »
Thanks for your reply Prince.

I have tried the solution which you have given, but its not working.

Any ohter solution for this.

Offline charon

  • Community Leader
  • *****
  • Posts: 144
  • Forum Citizenship: +7/-0
Re: How to get 0 if we don't have data
« Reply #3 on: 03 Feb 2012 08:33:07 am »
so the requierement is to display two more columsn with no data in it?
2 suggestions...work in FM on the package/ etl and add columns to the table..
or edit 2 static columns with no entries, and edit in cognos the way he works with no data fields.
- knuffel the muffel in the puffel -

Offline mmcalli

  • Associate
  • **
  • Posts: 3
  • Forum Citizenship: +0/-0
Re: How to get 0 if we don't have data
« Reply #4 on: 03 Feb 2012 09:12:12 am »
Left outer join between your time dimension table and your fact table. That way you'll get all months from your time dimension, and if there are no facts, you'll get NULL for the measures for those rows.

Offline Grim

  • Honorary Master of IBM Links
  • Statesman
  • ******
  • Posts: 268
  • Forum Citizenship: +26/-5
Re: How to get 0 if we don't have data
« Reply #5 on: 03 Feb 2012 09:30:30 am »
Not sure this applies, but here it is anyway...
http://www-01.ibm.com/support/docview.wss?uid=swg21341663
"Honorary Master of IBM Links"- MFGF
Certified IBM C8 & C10 Admin, Gamer, Geek and all around nice guy.
<-Applaud if my rant helped! 8)

Offline saumil287

  • Community Leader
  • *****
  • Posts: 152
  • Forum Citizenship: +1/-0
Re: How to get 0 if we don't have data
« Reply #6 on: 04 Feb 2012 12:00:58 am »
Hi
You can also use if then else construct to display 0 in place of blank.

Offline 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: How to get 0 if we don't have data
« Reply #7 on: 04 Feb 2012 02:45:39 pm »
This is not about trying to substitute non existing data with zeroes (or any other formatted output) For a relational package a crosstab will simply only show the grid of existing intersections.

If you fetch no data for 2 months (i.e. no data exists for these months based on query def.)
, these will automatically not appear in the crosstab. This is a bit confusing for those brought up with dimensional models.

In some cases the left outer join strategy will work. In other cases you may need to build the crosstab against a union of  'real data'  and a set based on a cross-join of the time dimension and fact related attributes where the measure is defined as a dummy 0  (zero)
Oracle9i,DB2/AS400/Busobj 6.5/Powercenter7/Cognos8 /
SSIS 2005 / SQL SERVER 2005 /PowerDesigner 12.5/15