on 12-19-2008 5:36 PM
Hi
I have a question
I have 3 tables(X,Y,Z) connected to a dimension A, and they form a loop.
I have built 2 aliases on A to connect to 2 of these tables and joined one table directly to table Z.
So X is joined to A_X,
Y is joined to A_Y
& Z is joined to A).
I want to know, should I build objects straight out of the Dimension A and have reports built on these objects and objects from X, Y or Z.
These 3 tables have different contexts on each of them and are disjoint tables.
Or should objects be built on aliases only and not the main table.
Thanks
Hi BOUser,
Once you have created 3 different aliases you must treat them as if they were separate tables.
If you have a column C on Dimension_A, then you will also get a Column_C on A_X and A_Y. However, if you point an object to Dimension_A.C it will not get you A_X.C or A_Y.c
A real world example might help explain it better
Imagine you have an Order, Invoice, Transaction, containing Order_Date, Invoice_Date and Transaction_Date. Each of these point to a Date_Lookup table, which has been aliased as Order_date_lookup, Invoice_Date_Lookup and Transaction_Date lookup. Assuming the Date Lookup columns you want to expore are month, day and year. Then you will need to create 3 classes, one for each lookup with 3 fields.
Class:Order Date
Object:Year,SQL:Order_Date.Year
Object:Month,SQL:Order_Date.Month
Object:Day,SQL:Order_Date.Day
Class:Invoice Date
Object:Year,SQL:Invoice_Date.Year
Object:Month,SQL:Invoice_Date.Month
Object:Day,SQL:Invoice_Date.Day
Class:Transaction Date
Object:Year,SQL:Transaction_Date.Year
Object:Month,SQL:Transaction_Date.Month
Object:Day,SQL:Transaction_Date.Day
So to answer your question, it is really both. It is all about what you want the user to see.
Hope this helps
Alan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Alan,
Instead of creating alias tables, can you create 3 contexts? Without the separate alias tables, can I then organize my class structure with only 1 Date class shared amongst the Order, Invoice, Transaction metrics as:
Class:Master Date
Object:Year,SQL: Date.Year
Object:Month,SQL: Date.Month
Object:Day,SQL: Date.Day
Class:Order
(List of Order Metrics)
Class:Invoice
(List of Invoice Metrics)
Class:Transaction
(List of Transaction Metrics)
Which method would you say is a better best practice?
Thanks,
Jimmy
Hi Jimmy,
It really depends on what you want to do. If you want to have a query that uses mulitple dates, say you wanted to limit by order date and invoice date then the 2 classes are better. Otherwise use your approach. As a rule, I think people find it easier to follow the alias approach easier to follow/describe
Regards
Alan
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.