SQL For Modeling Generalization Hierarchies
Jul 20, 2005
Is there a good approach to modelling many heterogeneous entity types
with that have some attributes in common?
Say I have entities "employees" which share some attibutes (e.g.
firstname, lastname, dateofbirth) but some subsets of employees (e.g.
physicians, janitors, nurses, ambulance drivers) may have additional
attributes that do not apply to all employees. Physicians may have
attributes specialty and date of board certification, ambulance
drivers may have a drivers license id, janitors may have
preferredbroomtype and so on.
There are many employee subtypes and more can be dynamically added
after the application is deployed so it's obviously no good to keep
adding attributes to the employees table because most attributes will
be NULL (since janitors are never doctors at the same time).
The only solution I found for this is a generalization hiearchy where
you have the employee table with all generic attributes and then you
add tables for each new employee subtype as necessary. The subtype
tables share the primary key of the employee table. The employee table
has a "discriminator" field that allows you to figure out which
subtype table to load for a particular entity.
This solution does not seem to scale since for each value of
"discriminator" I need to perform a join with a different table. What
if I need to retrieve 1,000 employees at once?
Is that possible to obtain a single ResultSet with one SQL statement
SQL?
Or do you I need to iterate look at the discriminator and then
perform the appropriate join? If this kind of iteration is necessary
then obviously this generalization hierarchy approach does not work in
practice
since it would be painfully slow.
Is there a better approach to modelling these kind of heterogeneous
entities with shared attributes that does not involve creating a table
for each new employee type or having sparce tables (mostly filled with
NULLS)
I guess another approach would be to use name/value pairs but that
would make reporting really ugly.
Seems like a very common problem. Any ideas? Is this a fundamental
limitation of SQL?
Thanks!
- robert
View 13 Replies
ADVERTISEMENT
Nov 5, 2006
Can someone please explain this statement: At the logical level where there can be any number of entities in a relationship while physically you define relationships between two tables.
thx,
Kat
View 1 Replies
View Related
Apr 15, 2006
Hi!
So sorry for posting yet another one of my silly posts about the correct way of doing things!
I am using Stored Procedures to do various things in my database (inserting/deleting/updating) and using SQL Server 2000 SP4
The current situation is that I have a stored procedure which checks certain user details and returns either -1 or 1 as a success indicator to the caller.
Now, obviously if we executed several queries in this stored procedure, performance will be an issue.
However, I have no idea how to balance up the whole "more useful information" vs "general information". What I mean is this:
if we are checking 3 items in a table, I want to return the success value back to the caller - in this case, we could do an IF statement to see if the record exists, if it does, set the return value to 1, else, -1.
But then you may want to be more informative to the user, specifically stating what part of the information they entered is incorrect/invalid. So having this in mind, we would then need to execute, say, 3 queries to return a more specific "error" value.
What should I do in this case?
I want to check the username, password and if the account is activated.
Currently I have this query going on:
IF EXISTS (SELECT [ID] FROM Users WHERE username = @un AND [password] = @pw AND activate = 1)
SET @theResult = 1
ELSE
SET @theResult = -1
firstly, is that the good way of doing things? if not - then what is the better way?
secondly, if we decide that we want a specific detailed return value/error message, it would mean I have to check the results I want using a couple more queries, such as one query to check username, one query to check password and another to check if the account is active or not and then return the appropriate value back to the caller.
is this a good way of doing things? I am confused and stuck!
Many thanks for your valuable response :)
View 3 Replies
View Related
Aug 2, 2007
I have a db design which includes generalization/specialization. How can I implement this in sql server?
thanks so much!
View 4 Replies
View Related
Dec 12, 2006
please help, I need professional approach how to realize generalization(parent_table <- child_table) idea in sql server databse?in my Oracle db I can have PK of child_table as FK from parent_table: let'shave shop with shoes, selling shoes, and foosd as well. Example of keys inmy tables:Product (=parent_table)-------------12345Food (=child_table)-------------234Shoes (=child_table)-------------15Is that good idea, or not, and may I have the same in SQLServer (2005) ?(and, what about administrative aspects (likeperformance/concurency/updating ..) of generalization in RDMS?)regards
View 1 Replies
View Related
Feb 6, 2005
As promised, question #2... ;)
As I mentioned in my previous post, my "real" case is a cube with 79 dimensions, most of which virtual, have been added for convenience.
Think for instance about a time dimension... Wouldn't it be nice to get a matrix with years horizontally, months vertically and displaying say the number of order you had for each cell in the resulting grid.
Ok, maybe you can do this with MDX but not in Excel, unless you create virtual dimensions for the Year and Month levels.
That's all good, but as it is, in my real case, I end up with four date dimensions for which I have to provide:
YQMD (Year, Quarter, Month & Day) hirarchized dimension
YWD (Year, Week, Day)
YQMD (Fiscal calendar)
Year
Quarter
Month
Week
Day (as 1, .. 31)
Week Day (for periodicity analysis over a week's time)
Date (as individual day - this is the backbone for the virtual dimensions)
It turns out this makes 40 dimensions by itself. For the sake of it, I grouped them by 4 hierarchies, although I've seen no specific functionality off of this in the data browser or Excel, so it really seems to be only for "show".
Now in my previous post I explained how I "spread" my session count to calculate a conversion rate. Given the number of dimensions I have (very high segmentation at the order level, very limited segmentation at the session/visit level), this means my calculated cell formula looks like this (hold your breath, it's ugly):
SubCube: {[Measures].[Session Count]}, DESCENDANTS([Business Unit].[All]), DESCENDANTS([Channel Source].[All]), DESCENDANTS([Currency].[All]), DESCENDANTS([FO Product Segment].[All]), DESCENDANTS([FO Quarter].[All]), DESCENDANTS([FO Value Segment].[All]), DESCENDANTS([Is Cancelled].[All]), DESCENDANTS([Is Customer Care].[All]), DESCENDANTS([Is Design Services].[All]), DESCENDANTS([Is Direct].[All]), DESCENDANTS([Is Estimated].[All]), DESCENDANTS([Is Holiday Order].[All]), DESCENDANTS([Is New].[All]), DESCENDANTS([Is Sales Services].[All]), DESCENDANTS([Language].[All]), DESCENDANTS([Payment].[All]), DESCENDANTS([Product Segment].[All]), DESCENDANTS([Value Segment].[All]), DESCENDANTS([FO Channel].[All]), DESCENDANTS([Reg Channel].[All]), DESCENDANTS([FCD].[Date].[All]), DESCENDANTS([FCD].[Day].[All]), DESCENDANTS([FCD].[Mth].[All]), DESCENDANTS([FCD].[Qtr].[All]), DESCENDANTS([FCD].[Wk].[All]), DESCENDANTS([FCD].[WkDay].[All]), DESCENDANTS([FCD].[Year].[All]), DESCENDANTS([FCD].[Fiscal].[All]), DESCENDANTS([FCD].[YMQD].[All]), DESCENDANTS([FCD].[YWD].[All]), DESCENDANTS([FRD].[Date].[All]), DESCENDANTS([FRD].[Day].[All]), DESCENDANTS([FRD].[Mth].[All]), DESCENDANTS([FRD].[Qtr].[All]), DESCENDANTS([FRD].[Wk].[All]), DESCENDANTS([FRD].[WkDay].[All]), DESCENDANTS([FRD].[Year].[All]), DESCENDANTS([FRD].[Fiscal].[All]), DESCENDANTS([FRD].[YQMD].[All]), DESCENDANTS([FRD].[YWD].[All]), DESCENDANTS([FSD].[Date].[All]), DESCENDANTS([FSD].[Day].[All]), DESCENDANTS([FSD].[Mth].[All]), DESCENDANTS([FSD].[Qtr].[All]), DESCENDANTS([FSD].[Wk].[All]), DESCENDANTS([FSD].[WkDay].[All]), DESCENDANTS([FSD].[Year].[All]), DESCENDANTS([FSD].[Fiscal].[All]), DESCENDANTS([FSD].[YQMD].[All]), DESCENDANTS([FSD].[YWD].[All])
Caculation Value: CalculationPassValue(([Business Unit].[All],[Channel Source].[All],[Currency].[All],[FO Product Segment].[All],[FO Quarter].[All],[FO Value Segment].[All],[Is Cancelled].[All],[Is Customer Care].[All],[Is Design Services].[All],[Is Direct].[All],[Is Estimated].[All],[Is Holiday Order].[All],[Is New].[All],[Is Sales Services].[All],[Language].[All],[Payment].[All],[Product Segment].[All],[Value Segment].[All],[FO Channel].[All],[Reg Channel].[All],[FCD].[Date].[All],[FCD].[Day].[All],[FCD].[Mth].[All],[FCD].[Qtr].[All],[FCD].[Wk].[All],[FCD].[WkDay].[All],[FCD].[Year].[All],[FCD].[Fiscal].[All],[FCD].[YMQD].[All],[FCD].[YWD].[All],[FRD].[Date].[All],[FRD].[Day].[All],[FRD].[Mth].[All],[FRD].[Qtr].[All],[FRD].[Wk].[All],[FRD].[WkDay].[All],[FRD].[Year].[All],[FRD].[Fiscal].[All],[FRD].[YQMD].[All],[FRD].[YWD].[All],[FSD].[Date].[All],[FSD].[Day].[All],[FSD].[Mth].[All],[FSD].[Qtr].[All],[FSD].[Wk].[All],[FSD].[WkDay].[All],[FSD].[Year].[All],[FSD].[Fiscal].[All],[FSD].[YQMD].[All],[FSD].[YWD].[All],[Measures].[Session Count]), 0)
If you read all this, you can see already the cryptic dimension names like "FRD", "FSD" and so forth... that's because with the real names ("First Refund Date", "First Ship Date", the query processor errored out... visibly there is a limit in the size of the formulas you can post!
Is there no other way to achieve this result? Basically I mean to say: if the session count is not defined at your level along this dimension, go to the root of the dimension to get the value there, this along a slew of dimensions, many of which are inherently dependent because of the usage of virtual dimensions (therefore if I wish to go to the root of my "First Refund Date" for instance, I wish to do so along all sub-dimensions... Heck, as far as I'm concerned this is conceptually only ONE dimension, just with various views upon it...
Using hierachies I was sort of hoping for the ability to have something like:
[FRD].[All Hierachies].[All]
Am I just asking for too much or do I just not know (quite probable) the magic keyword that can do this?
Where this is becoming quite critical is that I actually have a calculated cell that goes as follows (abridged):
SubCube: similar as before
Calculation: [Measures].[Order Count]*CalculationPassValue((...set of all un-tied dimension roots..., [Measures].[Distributed Marketing Cost])/CalculationPassValue((...set of all un-tied dimension roots..., [Measures].[Order Count])
Now the purpose of this is to distribute external costs at the order level. In short, say that you know you spent $10,000 globally promoting a specific group of websites in commission money (you pay $1 for each order). This formula allows me to get that a specific website, with 20 orders incurred an additional marketing cost of $20. That's actually the object of my next thread's question (spreading a multiplication through the aggregations)
For the purpose of this thread I am just concerned about the size of my formulas. Renaming the dimensions seemed to "buy" me some margin and I was actually quite surprised to find that the formula still fitted in, and works, but it is only a matter of time until I have to add more dimensions and the whole thing blows up in my face. Adittionally this is obviously not pleasant to look at and maintain.
Any better solution?
Thanks,
Seb
View 1 Replies
View Related
May 27, 2008
Hi,
Nwebie question:
is it possible to have a fact that will behave diffeerntly as the user
is viewing it from different hierarchies? say i got creatin measures
of a product inventory. i got a location hierarchy, as as user is
'moving up' in it (say,up by city, region, state, country...)i want to
do a sum. but i also got time hierarchy, and as user begins to group
by weeks, months, years... a sum makes no sense..i want LastNonEmpty
or something like that. Is it possible?
thanks!
View 9 Replies
View Related
Feb 21, 2000
Are there any pitfalls when naming SQL Server 7.0 objects with underscores, caps, etc.?
View 1 Replies
View Related
Jul 11, 2007
Hello everybody,
I'm new to Sql.
Can anyone explain me
Data Modeling.
Thanks.
shiak bee.
View 3 Replies
View Related
Nov 1, 2006
I am having a problem when modeling a Foreign Key in an "Operations" table. This table holds all information on customers ´s applications and withdrawals.
Here is the structure:
CustomerID int, SourceID int, Value decimal (16,2), OperationDate datetime
Well the problem is that SourceID sometimes might be NULL depending on how the record was inserted. So its kind of cumbersome to define it as an FK, since it can be null...To get things worse, this SourceID might point to more than 1 table (depending on the CustomerType it will point to SourceA table or SourceB table)...
How should this be modeled?
View 1 Replies
View Related
Jan 24, 2004
Hey all. I have a query where I am basically querying an organizational chart. The table storing this information is basically a two column table of parent/child pairs. So you might have:
parent | child
1 | 2
2 | 3
2 | 4
3 | 6
3 | 7
4 | 8
5 | 9
8 | 10
8 | 11
Querying this table should return all child columns that flow up to the top, so querying 1 would return 1, 2, 3, 4, 6, 7, 8, 10, 11.
I used a sample from MSDN (http://www.sqljunkies.com/Article/D7CAED46-CCAC-4FF7-B528-B2E9A274B71C.scuk) that does just this, except that when querying a value that returns more than 1000 records - I am experiencing way too long response times. The MSDN sample uses temp tables and inserts values into a temp table as it moves through the records and finds a match.
Anyone have an ideas on another way to accomplish the same thing? This is an important part of my security model as users that login should only have access to data that falls within their parent/child heirarchy.
Thanks.
Jon
View 20 Replies
View Related
Jan 25, 2004
Hi SQL Server Experts,
Oracle has a 'Connect by prior' extension to SQL that is neat for display hierarchies.
Does SQL Server have anything simialr or would I use T-SQL or ???
I will appreciate any suggestions and advice.
B.Dimple
Junior DBA
View 5 Replies
View Related
Oct 31, 2007
i guess really i'm looking for opinions and / or experiences of modelling organisational hierarchies.... anyone?
i'm in the process of creating a logical model (very early stages) of a new datawarehouse. The current OLTP schema stores it as a self referencing key (i.e. parent_group_id). The performance problems involved in aggregating to different levels of the hierarchy causes no end of complaints from customers, as i'm sure you can imagine. So, now we are modelling a datawarehouse for their reporting requirements, i obviously want it to be better
so far i've considered...
1) keeping it as it is
2) allocating a 'node' id and storing the left / right nodes in the hierarchy tree. we've used before when reporting over the OLTP system with report developers building it 'on the fly' as part of their report.
(better explanation than mine... http://www.dbpd.com/vault/9811/kamfn.shtml )
3) an intermediate table storing its 'position' in the hierarchy? not really played with this yet but mr kimball seems to like it
see... http://www.dbmsmag.com/9809d05.html
4) denormalising it completely. i.e. level_1, level_2, level_3, Level4.... for every fact? the advantage of this is that it makes aggregation at any level really easy. the problem is that each of our customers has a different organisation hierarchy, with a different number of levels, and given the OLTP schema there is no limit to the number of levels in a hierarchy
so... thoughts / experiences anyone?
Em
View 2 Replies
View Related
May 19, 2008
I have a date dimension and Fiscal Year is a Hierarchy in it, like April, August and October for different fiscal years. I need to populate this in a report (SSRS) in a combo box so that the user can pick the fiscal year he/she wants. When done, I want to know what is the Fiscal year start month is, like April for April Fiscal year etc.
How do I achieve this? Is it even possible?
View 3 Replies
View Related
Aug 25, 1998
Hi,
does anyone know of any data modeling tools that support or intend to support SQL 7.0 ?
I`d appreciate any comments ...
Kris Klasen
Act. Manager Data Warehouse Project
Information Management Branch
Department of Education, Training, Community and Cultural Development
E-mail: Kris.Klasen@Central.Tased.Edu.Au
http://www.tased.edu.au
Tel: 03 6233 6900
Fax: 03 6233 6969
73 Murray Street
2nd Floor
Hobart 7000
Tasmania
View 2 Replies
View Related
Jun 19, 2006
is there a link in this forum that speks about datamodeling or datawarehouse. iam looking for some help regarding the model that i have to build. i am not able to find a relation between different dimensions in terms of time which would be th e key to populate the fact table.
any help appreciated
View 1 Replies
View Related
Jul 23, 2005
I'm facing the next problem:I have a table with two columns (among others) modeling category andsubcategory data for each row. I need to summarize info on this twocolumns, but with the next specs:1.- Some grouping is only on the category column.2.- Some other grouping consider the two columns.The values for the two columns come from external source, i.e. I haveno means to know the precise universe of data (I suppose soon or laterwe'll have a sufficient sample of data, but for now it's not thecase). So, I would like to have a grouping table so it's not necessaryto insert a row for every pair of category and subcategory (althoughit would be the best approach for the sake of design's simplicity). AsI don't know every possible combination, I would prefer something like'this category is a - no matter the subcategory', and 'this othercategory + subcategory is b'. Let's go with a sample:--------------------------------------------------------Create Table B ( -- groupings ----categ char(8),subcateg char(5),what_group char(10))-- All rows with 432 code are cat. A ----Insert B ( '00000432', ' ', 'Category A' )-- All rows with 636 code are cat. C except when subcat is 8552 (cat.B) ----Insert B ( '00000636', '08552', 'Category B' )Insert B ( '00000636', ' ', 'Category C' )-- Some data ----Create Table A ( -- data ----categ char(8),subcateg char(5))Insert A ( '00000432', '01322' )Insert A ( '00000432', '01222' )Insert A ( '00000432', '01100' )Insert A ( '00000432', ' ' )Insert A ( '00000636', '08552' )Insert A ( '00000636', '08552' )Insert A ( '00000636', '01100' )Insert A ( '00000636', ' ' )Insert A ( '00000636', '01111' )-- The query like:Select b.what_group, count(*) as cntFrom aLeft Join bOn /* ? ? ? ? */-- Should give ---what_group cnt-------------- ----------Category A 4Category B 2Category C 3-------------------------------------------------------------------It would be easier knowing all the pairs categ - subcateg. If I don'tknow them, is a good idea to model the grouping table as I've donewith rows in B?TIA,DiegoBcn, Spain
View 1 Replies
View Related
May 4, 2006
Good day.
i'm a new person here and not that familiar with T-SQL...
the question is: is there any buil-in functions or special libraries in T-SQL that can help to generate correlated random variables with non-normal distribution function?
It would be also good if someone could advice if there is any application (statistical programm or non-microsoft developed library) that can deal with MS SQL and has modeling and forecasting capabilities...
thanks in advance
View 6 Replies
View Related
Sep 23, 2015
I have an existing MDX query returning the correct resultset. However, I want to add a filter so that for a combination of value in Hierarchy1 and Hierarchy2, the data is filtered out.
For example I have data like
H1Â Â Â H2Â Â Amount
1Â Â Â Â Â 1Â Â Â Â Â 100
2Â Â Â Â Â 1Â Â Â Â Â 50
3Â Â Â Â Â 1Â Â Â Â 45
I am getting a value of 100+50+45=195.
I want to filter the data for the combination H1=3 and H2=1. Expected result would be 100...
H1Â Â Â H2Â Â Amount
1Â Â Â Â Â 1Â Â Â Â Â 100
2Â Â Â Â Â 1Â Â Â Â Â 50
View 2 Replies
View Related
Jun 12, 2015
I want to be able to implement infinite levels of Hierarchies in SQL Server (2012), in addition to being able to address issues like same child having more than one parent (eg. An Employee could end up having 2 different managers - eg. Project Manager, Â Delivery Manager).
One way is to have self referencing table (where each row has a parent id , referencing to a parent record - but this would not work in cases where a child  has more than 1 parent).
Are there other more efficient ways? What is the best way to implement this?
View 9 Replies
View Related
Apr 20, 2006
I am currently looking at the capabilities in SSIS from the point of view of an ETL developer who has worked with other products eg. Informatica, Cognos DecisionStream and one of things I note is a lack of support for dimensional hierarchies.
It appears that MS have assumed that SSIS users will automatically use SSAS.
We use Hyperion Essbase. Other sites have Cognos or Business Objects for their OLAP/BI.
I would like to be able build multi-level dimension hierarchies directly from within SSIS.
Has MS considered this for future versions?
View 2 Replies
View Related
Mar 4, 2014
I have a case study requesting to create an ER diagram, with the attributes listed in each entity. The data I have is an Excel Spreadsheet listing:
CustomerName
PurchaseDate
Destination
Airline
Flight#
departDate
DapartTime
ArriveTime
Hotel
CheckIn
CheckOut
Car Rental
Pickup
Return
The case is related to travel agency that specializes in booking interesting vacations for people who are single. Note that the travellers have a variety of travel bookings: some may rent a car and drive to the hotel at their destination, others may be staying with friends or relatives at their destination, while others will need flights, hotel and car rentals in their booking.
creation of the Tables and their attributes to Normalize the model to 3NF.
View 2 Replies
View Related
Feb 24, 2007
I'm trying to determine the best approach to model tables for a registration form that will be used temporarily and then taken offline once the event is over. I'd like to either model the tables so that they were reusable for other registration forms or perhaps use another method to store the data, maybe using XML or some other method if that is possible?? I'm not sure.
Different registration forms would have different input fields thereby requiring different table structures. It seems inefficient to create tables that will only be used temporarily and then no longer used. So, I would need to remember to delete the tables after they have been used or they would just take up space.
The basic requirement for this registration form is to allow the user to fill out the required fields, submit, get a registration reciept confirming their registration and allow the administrators for the event to pull the data weekly or daily into an excel spreadsheet.
I can create a flat table and a stored procedure that inserts the data. I can also write the dts package that exports the data to an excel file, which would require my intervention. I'd like to have something more automatic without my intervention.
Any suggestions would be appreciated. I'm not sure the best approach for this. Is using tables the best way to go even if the tables aren't re-usable? Requiring my attention to delete afterwards.
What are the options to generate the excel reports without my intervention?
Thanks in advance for any help.
View 1 Replies
View Related
Mar 12, 2015
I've built a robust looking Calendar dimension but that's easy because its all so well structured. Every date belongs to a particular week and every week belongs to a particular month and every month belongs to a particular quarter etc. January 1st is always going to be a member of week 1, month 1, quarter 1.But here's the rub, real life isn't as predictable and stable as a calendar.
Lets say you have an table containing personal information. You might have gender and marital status in there and even though they both relate to one person, they're unrelated to each other so how do you put those in a hierarchy? Which one goes first and which second because you can get combinations of either.
View 1 Replies
View Related
Dec 17, 2006
Hi,
I am currently trying to develop an application which would help in retrieving data from cubes (Microsoft Analysis Services)! The user would not be accessing the Business Intelligence Studio, etc. but would be viewing the data from a custom made application developed in VB.Net2005.
While implementing this, I want to populate the drop-down-list in the VB(.Net) Form, by retrieving the various hierarchies in the dimensions of the cubes (along with dimensions if possible). This should be done dynamically and in real-time!
Can you please help in implementing this? Any code/method, etc would be highly appreciated!
Thanks in advance.
Best wishes!
(Software : SQL Server 2005 Enterprise Edition (with Analysis Services and BI Studio), VS.Net 2005 Enterprise Edition, ADOMD.Net)
View 1 Replies
View Related
Dec 27, 2006
I am running the Office Professional Plus 2007 RTM with all options enabled and SQL 2005 Developer Edition on my local box. Based on the system requirements listed on the download page for the Office 2007 Data Mining Add-In, I've also verified that I have the correct CTP of SQL 2005 SP2 and that .Net 2.0 Framework is installed. Finally, I've verified that my local instance of SQL Server is configured correctly to allow temporary data mining models.
In Excel, all of the Table Analysis tools seem to work fine, and most of the options on the Data Mining ribbon also work; however, all of the options under "Data Modeling" on the Data Mining ribbon return the following error when I try to use them:
"Could not load file or assembly 'Microsoft.DataWarehouse, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependents. The system cannot find the file specified."
I've tried uninstalling everything and reinstalling, but I still get this error when I try to use the Data Modeling options.
Right now, I'm only working against the sample data provided when the data mining add-in is installed.
Any ideas on how to resolve this issue?
View 7 Replies
View Related
May 5, 2005
Good day all
I am unable to crosstab different alternate hierarchies of an MSAS cube from a single dimension, I'm using Cognos Powerplay (7.3 web and client) to browse the data. v 7.1 displays the same behaviour.
When I try to create the crosstab the display replaces both rows and columns to the alternate path, it overwrites the original path. Can anyone tell me if this is a Cognos issue or an Analysis services one and if there is any way around it. The only solution I have at the moment is to bodge it by creating seperate dimensions for each alternate hierarchy however this is ugly and difficult to use.
Regards
Mike
View 7 Replies
View Related
Jul 2, 2015
IÂ am stuck in a situation where I want to use YTD for three different calendars of our company and don't want to create three different YTD calculations. However I want to make this work for any measure not for a particular measure
If I create one YTD and try to use in context of three calendars in SCOPE statements then it does not give my right results. Following is my syntax but It does not work.
SCOPE([Billing Date].[SalesCalendar].MEMBERS);
( [Aggregate].[AGGREGATE CODE].[YTD] )Â Â Â
         = Aggregate({[Aggregate].[AGGREGATE CODE].DefaultMember}*{PERIODSTODATE([Billing Date].[SalesCalendar].[Sales Calendar Year],[Billing Date].[SalesCalendar].CURRENTMEMBER) } );
[Code] ....
However if I comment on one of SCOPE statement , other one works but both don't work simultaneously in context of different calendars.
View 2 Replies
View Related
Nov 20, 2006
Hello,
I need a tool that will let me model a SQL Server 2005 database and then generate the tables, constraints, etc. from the model. I've never used a modeling tool so my knowledge is quite limited. I don't need to model or reverse engineer an application - my sole concern is on the SQL Server database side. I'm not concerned if the tool integrates with Visual Studio. And, of course, price is one consideration.
Are there any good tools that I should look at?
Thanks,
BCB
View 3 Replies
View Related
Oct 8, 2007
Hi all
Probably not the right forum - pointers would be appreciated - but I'll give it a try anyway:
I'm in the process of designing a relational database to be used in a BI scenario - ie. dimension and fact tables. The data will eventually be used to feed cubes in Analysis services, however end users will probably be allowed to run reports aginst views of the relational database.
I'm currently looking at the employee dimensions and my first try would designate AGE as a SCD Type 2 attribute. As a result every employee gets at least one new record every year as AGE increases. Given that BIRTHDATE is specified should I drop AGE from the tables and recreate it as a computed attribute in database views and/or cubes?
Regards, Steen
View 7 Replies
View Related
Nov 30, 2006
Hello--
A question has come up around the following situation where a number of analysts will building data mining models in a specific analysis services databases.
- There is one AS DB for each modeling "project" and the analysts assigned to work on the "project" are grouped together in Windows Security Groups.
- The analysts are only allowed to access the AS DB for their project. To support this security model, we've implemented scripts to create the AS DB for the "project" and then a Role is created within the AS DB called "Administrator" and the members of this role are the members of the corresponding Windows Security Group.
The AS DB, role and membership are created by a machine "admin". After the AS DB is created, it appears that the only way an analyst can build models using Visual Studio (Business Intelligence Workbench) in the AS DB while maintaining the security model is to do the following:
- Run Visual Studio (or BI Workbench)
- Select File -> Open -> Analysis Services Database, then specify the database that they have access to.
In this "online" modeling environment, things are working fine. The question is -- is it possible for an analyst to create an Analysis Services Project in Visual Studio and "bind" it to already-created AS DB? This doesn't appear to work, but I may be missing something.
Thanks,
- Paul
View 1 Replies
View Related
Jun 17, 2015
Our business model involves a lot of dates and the business owners frequently want reports based on each of these different dates. For example in any given order there are as follows:
- Order created date
- Client due date
- Order first payment date (an order can have multiple payments)
- Order fully paid date
- Date assigned to vendor
- Vendor return date
- Date delivered to client
On top of that we have other areas of the business, the data from which ties into the above. Here we have more dates e.g.
- Date vendor recruited
- Date vendor reviewed
At any given point the manager may want a report based on any of these dates. For example;
- Product type by order creation date (fiscal year / month)
- Product type by first payment date  (fiscal year / month)
- Product type by client due date (fiscal year / month)
and so forth. I have been asked to create a report using all of the above on at least one occasion, many of them far more frequently. At the moment I have created a standard date table and then duplicated that for each type of date that I need however this is becoming excruciating to work with as I have approximately 10-12 date tables in my data model. Is there a better way of doing this now, in Excel 2013? If not, is there an improvement in 2016 that may make life easier?Â
View 6 Replies
View Related
Sep 20, 2011
I have some confusion on crossjoin function within MDx.while I try to crossjoin the different level sets of same Hierarchy. It shows error as
For example.
‘The Customer Geography hierarchy is used more than once in the Crossjoin function.’
select {
{[Customer].[Customer Geography].[Country].&[United States]}*
{[Customer].[Customer Geography].[State-Province].members}}
on 0
FROM [Adventure Works]
WHERE Measures.[Internet Sales Amount]
Cannot we Cross joins across user defined hierarchies ,or they aren't supported .?Coz I really need to implement as above MDx within my real Cube.I try to implement by making as another Hierarchy Member but it doesn’t gives the value result as what we want/need.with
member [Customer].[Country].[United States ]as [Customer].[Customer Geography].[Country].&[United States]
select {
{[Customer].[Country].[United States ]}*
{[Customer].[Customer Geography].[State-Province].members}}
on 0
FROM [Adventure Works]
WHERE Measures.[Internet Sales Amount]
View 11 Replies
View Related