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

Multiple Fact modelling - Best approach

Started by Ahchay, 24 Oct 2011 07:39:10 AM

Previous topic - Next topic

Ahchay

Hello all, hoping someone here can help with this as I'm tearing what little hair I have left out trying to get this to work.

One liner - how can I get Cognos 8.4 to correctly model multiple fact schemas?

More details. I have two fact tables, at different levels of granularity for our booking and itinerary information (we're a holiday company, but these are roughly analogous to an invoice and invoice line tables). The general relationship here is that one booking contains many invoice lines.

We have modelled these into two fact tables with associated dimensions - as follows:
DIM_BOOKING

i_SK_BkgBookingRefLeadName
11000C SMITH
21001C JONES
31002S BOYCE

DIM_ITIN

i_SK_Bkgi_SK_ItinItinCodeItinDesc
11FLT001Flight
12ACC001Accommodation
13EXT001Ski Hire
14EXT002Boot Hire
15EXT003Lift Pass
26FLT001Flight
27ACC001Accom
38FLT001Flight
39ACC001Accom
310EXT001Ski Hire
311EXT003Lift Pass
312EXT003Lift Pass
313EXT003Lift Pass

FACT_BOOKING

i_SK_Bkgi_SK_ConfirmDatei_SK_DepartDatef_Paxf_Revenue
1201110012011121841800
220111005201112252750
3201110172012010431300

FACT_ITIN

i_SK_Bkgi_SK_Itini_SK_ItinDatef_Paxf_Revenue
11201112184300
12201112184500
13201112183300
14201112202700
25201112252250
26201112252500
37201201044300
38201201044250
39201201041100
310201201042200
311201201063400
312201201091100

I have modelled this as two seperate star schemas, joined by the common dimension DIM_BOOKING. I understand that I should then use determinants to force aggregation to occur at different levels, but no combination of these that I have tried seems to be quite right. The best I have managed to get is to set a Uniquely Identified determinant on the FACT_BOOKING table which gives me correct results in list mode, but not in cross-tabs (or, at least, not in all cross tabs)

Using a determinant at booking level gives me the following results on a per-booking cross tab:


Booking PaxItin Pax
1000313
100124
1002315
Totals932

Which is correct, however, if we try and run a per-itin description breakdown we get the following:


Booking PaxItin Pax
Flight910
Accommodation94
Ski Hire95
Boot Hire92
Lift Pass96
Accom95
Totals5432

Whereas I would expect that to be as follows:


Booking PaxItin Pax
Flight (all bookings)910
Accommodation (Booking 1 only)44
Ski Hire (Bookings 1 and 3)75
Boot Hire (Booking 1 only)42
Lift Pass (Booking 1 and 3)76
Accom (Bookings 2 and 3)55
Totals932

I think that's all the information I can provide on this, but feel free to ask for clarification - does anybody have any ideas on this?

Ahchay

Double post, but trying to get attachments to post. Attachment shows the logical join layer that I am currently using in FM.

Okay, uploaded to Flickr:


MultiFact by Ahchay, on Flickr

blom0344

Quick hint look at cardinality Booking Dimension to Booking Fact  (1:1 -- 1:1). A real multifact would be  1:1 -- 1:n..
I personally do not see the different grain by the way..

Ahchay

Quote from: blom0344 on 24 Oct 2011 09:16:39 AM
Quick hint look at cardinality Booking Dimension to Booking Fact  (1:1 -- 1:1). A real multifact would be  1:1 -- 1:n..
I've tried that as both, but in effect the dimension to fact relationship (in this example) is actually 1:1 - I get the same results though with this as 0:n

Quote from: blom0344 on 24 Oct 2011 09:16:39 AM
I personally do not see the different grain by the way..
A single booking can have multiple itiinerary items with the same code/description. For instance, 4 people might be on the booking but they may, between them, have booked several tuition days. So the booking pax (or passengers) would always be 4, but the Itin pax for Tuition could be as many as 12.

blom0344


Ahchay

Thanks for the link blom0344 - am trying to work through that now. Notice that the date on that document is 2005 - is this still valid for 8.x?

Oh, and I added in i_SK_Bkg in a previous attempt to do just as you described - I get the same results with that as by setting the determinant on FACT_BOOKING

blom0344

The modelling core does not depend on the exact 8 version. I think 2005 was the year of the 8.1 MR2 release, though in this case ReportNet (strictly a pre 8 version) is mentioned.
The shared dimension would have a unique determinant on the unique key for the dimension and a 'group by' determinant for the non-unique one

Ahchay

#7
Thanks for your patience with this, but still not working for me :(

I've tried remodelling the tables into a single fact table, as we've had some success doing things this way (but still not quite right!)

FACT_ITIN

i_SK_BkgKey to Booking determinant
i_SK_ItinKey to Itin Determinant
i_SK_ItinDateKey to Itin Determinant
f_ItinPaxItinerary Pax - Member of Itin Determinant
f_BookingPaxBooking Pax - member of Booking Determinant

i.e. I've combined both facts into a single table, with a Group By determinant on the booking and a Unique determinant for the itinerary line.

This *almost* works - as shown:


ItinPaxBookingPax
Accom53
Accommodation44
Boot Hire24
Flight109
Lift Pass65
Ski Hire57
Total(ItinDesc)3232

So, each of the per itinerary rows are correct (i.e. there are seven passengers on bookings which contain ski hire, although only 5 of those have actually bought it) but the Total line is still summing up all of the rows above it. What this needs to say is that, overall, we have sold to 9 passengers, but we have sold 32 individual things to them - as follows:


ItinPaxBookingPax
Accom53
Accommodation44
Boot Hire24
Flight109
Lift Pass65
Ski Hire57
Total(ItinDesc)329

Is this something that I can affect in the report?

(Edited for formatting)

blom0344

It IS right in the context of your initial issue, but you now want a a customized total in the report, which is okay, but has little to do with the modelling part. It basically means that you need to adjust the definition of the totalization to suit your need, like:

total(distinct [customerid] for report) if your query also fetches the customerid's involved

Ahchay

Okay, I'll try that (or, more exactly, I'll ask our report writing team to have a go - we're through the looking glass on this one with regards to my Cognos report writing skills) and let you know how we get on.