Analysis :: Bridge Table SCD Type 2
May 29, 2015
I have a bridge table used in my current design, the relation ship is FactTable -> DimRoom -> BridgeTable -> BedGrpoup. Fact table is joined with the Dim room dimension on room key, the bridge table maps values from the DimRoom and BedGroup dimension. The scenario I have is that the mapping between room and bed group can change during which I'm recording it in the effective date attribute in the bridge table.
Dimension usage on the cube is having a many to many relationship with bridge table.Example, if a fact occurred in room 100 which belonged to Bed Group A in Jan 2015 and then the room changed to Bedgroup b in feb 2015 and another fact happened in the room then I should have 1 count for jan in A and 1 in B for feb, I get that right when sliced by room, but when I slice by Month the cube does not honour time dim and displays both. I tried mapping the date from the bridge table to the fact as a regular relationship but that does not work either.
View 2 Replies
ADVERTISEMENT
Nov 24, 2015
I am using
SSAS: version 2008
Excel: version 2013
I am connecting to SSAS cube from Excel and I have date dimension with 4 fields (I have others but I don't use it for this case). I created 4 fields in order to test all possible scenarios that I could think of:
DateKey:
- Type: System.Integer
- Value: yyyyMMdd
Date:
- Type: System.DateTime
DateStr0:
- Type: System.String
- Value: dd/MM/yyyy (note: I am not using US culture)
- Example: 01/11/2015
DateStr1:
- Type: System.String
- Value: %d/%M/yyyy (note: I am not using US culture)
- Example: 1/11/2015
Filtering on date is working fine:
Initially, in excel, filtering on date was not working. But after changing dimensional type to time, and setting DataType to Date, as mentioned in [URL] filter is working fine as you can see in the picture.Grouping on date is not working:
I have hierarchy in my Date dimension and I can group based on hierarchy, no problem. But user is used to pre-build grouping function of excel, and he wants to use that. Pre-build functions of Excel, Group and ungroup seems to be available as you can see in following picture:
But when user clicks 'Group', excel groups it as if it is a string, and that is the problem. User wants to group using pre-build grouping function available in Pivot table. I also find out that Power Pivot Table does not support this excel grouping functionality. And if I understood well, this pre-build grouping functionality of excel, needs to do calculation at run time, and that is not viable solution if you have millions of rows. So Power pivot table does not support pre-build grouping functionality of excel and hence we need to use dimension hierarchy to do the grouping. But I am not using Power Pivot table, I am using simple Pivot Table. So I expect grouping functionality to be working fine. Then I tried to do simple test. I created a simple data source in excel itself. And use it as source of my Pivot table. Then grouping is working fine. The only difference that I can see is (When double click the Measure value in Excel),For date values of my simple test, excel consider them as 'Date'.
For date values of my data coming from cube, excel consider them as 'General'
2.1. But value here is same as it was in simple test.
2.2. 'Date Filter' works just fine.
2.3. If I just select this cell and unselect it, then excel change type to 'Date' though for that cell.
2.4. I have created 4 different types of fields in my date dimension thinking that values of attribute of my dimension might be the problem, but excel consider 'General' for all of them.
2.5 This value (that can be seen when double clicking on measure) comes from 'Name Column' of the attribute. And the DataType defined is WChar. And I thought that might be the reason of issue. And I changed it to 'Date'. But SSAS does not allow it to change to 'Date' giving error : The 'Date' data type is not allowed for the 'NameColumn' property; 'WChar' should be used.
So, I don't know, what is the puzzle piece that I am missing.
1. Date filter works, group does not work
2. Excel consider it as 'General' string.
3. SSAS does not allow to change 'NameColumn' to Date.
View 2 Replies
View Related
Jan 18, 2008
Hi,
is there a solution outside for getting of DB2 for OS/390 into SQL server?
I mean not replication or copying of data with flat files or an ETL tool, but a kind of integration of DB2 tables as they would be "normal" mssql tables.
Oracle has Transparent Gateways for os/z DB2 and many other non-Oracle databases, is there some similar for SQL Server?
Could it be realisable with an ODBC client for DB2?
Thanks
View 1 Replies
View Related
Aug 26, 2005
I have a setup with a bridge table. There are about 5 different tables
on one side of the bridge (all with compatable PK columns) one of which
is called 'mobilesub', and one on the other side called
'allcostcenters'. The bridge table is called 'subaccountcostcenter'.
I can enter data for mobilesub in the bridge table. But then when I try
to enter the info into the bridge table for any of the other tables,
such as localsub, there is a conflict like this:
INSERT statement conflicted with TABLE FOREIGN KEY constraint
'FK_subaccountcostcenter_mobilesub'. The conflict occurred in database
'test1', table 'mobilesub'.
The statement has been terminated.
Is there some rule against using a bridge table that references several
different tables, and I'm just not aware of it. Because I've done
everything I can to make sure the info from the different tables don't
conflict . . .
The same error comes up if I do the localsub table first--in that case
the foriegn key messing me up is FK_subaccountcostcenter_localsub. So
it's not something with the individual tables.
I need experienced advice lol
Thanks
View 1 Replies
View Related
Jan 18, 2006
Hey Everyone,I am a stored procedures newbie, so I wanted to ask if it is possibleto use them with PHP via an ODBC-ODBC bridge connected to a MS SQLserver. I am simply use the commands from the php odbc library toconnect and execute the SQL commands, I am trying to avoid buildingdynamic queries, so stored proceddures seem to be the answer. I knowthat there are only certain environments stored procedures can be usedwithin. Thank you for all of your help.
View 2 Replies
View Related
Sep 14, 2006
i have a query that i need to extend but just dont have the knowledge to do so, so hoping someone here could help me
this is my current query:-
SELECT ES.PatientID,
DATEDIFF(day, EP.DateofBirth, GetDate())/365 AS Age,
CASE EP.SexCode WHEN 'M' THEN 'MALE' ELSE 'FEMALE'END AS Gender,
COUNT(H.HRDID)AS HRD,
ES.FourRegularDrugs,
isnull(ES.FourRegularDrugsNo,0) as NoOfDrugs,
ES.ReadmissSixMonths,
PCE.[Primary diagnosis]
FROM tblStudyServices ES
INNER JOIN tblPatient EP ON EP.PatientID = ES.PatientID
INNER JOIN PAS.dbo.[PAS Patient Details] PP ON PP.[PAS key] = EP.PatientInternalNumber
INNER JOIN PAS.dbo.[PAS Admission Details] [PAD] ON [PAD].[PAS key 1] = PP.[PAS key]
INNER JOIN PAS.dbo.[PAS Consultant Episode] PCE ON PCE.[PAS key 1] = PAD.[PAS key 1] AND PAD.[PAS key 2] = PCE.[PAS key 2]
LEFT JOIN tblStudyServicesHRD H ON H.ServicesStudyID = ES.ID
WHERE
PAD.[Method of Admission] = 'AE'
AND
(PP.[Death Indicator] <> 1 OR PP.[Death Indicator] IS NULL)
AND
(CONVERT(CHAR(10),PAD.[Discharge Date],103) > DATEADD(year, -1, CONVERT(CHAR(10),GETDATE(),103))
OR PAD.[Discharge Date] IS NULL)
AND
DATEDIFF(day, EP.DateofBirth, GetDate())/365 >= 18
AND
ES.Consent=0
the problem arises with the Discharge Date. which basically says that the discharge date must be within a year or is null
a patient may have 3 admissions within that year but i need to only bring back the latest discharge as this is the latest admission.
pas key 1 pas key 2 discharge date
1 1 01/Jan/2006
1 2 01/Mar/2006
1 3 01/Apr/2006
so i want to bring back only the record that has latest discharge date - 01/Apr/2006
i also need to accomodate the following scenario where the patient is still in hospital and discharge date is null - so therefore bring back the record with the null discharge date as this is the latest admission
pas key 1 pas key 2 discharge date
2 1 01/Jan/2006
2 2 01/Mar/2006
2 3 <NULL>
any help is greatly appreciated as ill be learning something new!!
Cheers,
Craig
View 16 Replies
View Related
Oct 21, 2015
I have a fact, like this
DimCustomerKey, DimCardKey, Amount
1, 1, 20
2, 3, 30
1, 1, 40
3, 4, 50
2, 3, 50
I want a report like this
1, 1, 40
2, 3, 80
3, 4, 50
Logic :
- Each DimCustomerKey has only 1 DimCardKey
- If DimCardKey = 1, reported amount = max(amount)
- If DimcardKey other than 1, reported amount = sum(amount)
How can I implement this with MDX script ?
How can I implement this inside the CUBE (using scope or calculated member etc...)?
View 2 Replies
View Related
Aug 19, 2015
I am trying to find what datatype I can use for variable values like below in a column
E.g. column which we get
10000.10
100
180.34
98203710231.34
From the above example, you can see some of the values contains no decimal and with decimal
Also we cant say whether the decimal comes after the 5th number or 10th number. Any other datatype to capture this values. If not last option is to give varchar2.
View 3 Replies
View Related
May 21, 2015
I'm having trouble with cube processing. While processing a code I'm getting a "Invalid column name MessageType" error.
I unfolded the cube, then I opened "measure groups", my failing dimension (ServiceRequestDim) and the partition.
In the partition I opened the "Source" attribute so it now includes my column which was missing. But it didn't solve the issue.
If I get the query used during the process I'm getting this :
SELECT
DISTINCT
[ServiceRequestDim].[MessageType] AS [ServiceRequestDimMessageType0_0]
FROM
(
Select IsNull(IsDeleted, 0) as IsDeleted, [ServiceRequestDimKey], IsNull([Status_ServiceRequestStatusId], 0) as [Status_ServiceRequestStatusId],[Status],IsNull([TemplateId_ServiceRequestTemplateId], 0) as
[Code] ....
In the nested query which defines ServiceRequestDim the messagetype attribute is still missing. In my source datamart the ServiceRequestDim has the "MessageType" column.
So the question is where do I change the nested request that the dim process use to reflect the actual columns in my datamart .
View 4 Replies
View Related
May 8, 2015
I am using the following approach to enable dynamic date calculations: [URL] ...
However, some measures I work with are percentages (not numeric values) and demand a different formula.
See example snippet bellow (first IIF statement)
/*Calendar*/
[Date Calculation].[Calculation].[Calendar Actual versus PY WK %] =
IIF
(
[measures].Name = "HSP2 %", -- < ThIs is where I am trying to check if the measure is a percetgae type
0, -- < When this is the case then do something different
[Code] ....
I am trying to access the metadata. I am aware of $system.mdschema_measures but I am unable to utulize this for my case.
View 6 Replies
View Related
Jan 1, 2007
I am quite curious about SQL Server 2005 Express, since I am conducting an XQuery implementation survey for my thesis study.
Yet I still got some questions and may need your help:
1. Does SQL Server 2005 Express support XQuery static type analysis (from http://www.w3.org/TR/xquery-semantics/)?
2. If so, since the W3C standard is still changing, how do you keep up
with the change efficiently?
Your help will be appreciated.
Happy New Year and Thank you,
Selina, Wang
View 1 Replies
View Related
Jul 26, 2006
I notice that my XLMA code for Processing Update on my dimensions
fails some times. Unfortunately the SQL Agent does not detect this as a failure
and the job continues.
I do I include error handling in XMLA code so that the XMLA command failure is
detected by the SQL Agent Job scheduler
View 5 Replies
View Related
Dec 14, 2007
I like to define my procedure parameter type to match a referenced table colum type,
similar to PL/SQL "table.column%type" notation.
That way, when the table column is changes, I would not have to change my stored proc.
Any suggestion?
View 1 Replies
View Related
Jul 7, 2015
I Create a measure group and two dimensions using [AdventureWorksDW2012], I try to change one dimension's storage mode with setting property proactive caching as Real-Time ROlap. There is no any warning message when deploying and processing, but error occurs when I query in sql server analysis services, see below for the error messages and the screen capture.
Error occurred retrieving child nodes: the current operation was cancelled because another operation in the transaction failed.
View 2 Replies
View Related
Aug 11, 2015
I am working on a model where I have a sales fact table. Each fact record has four different customer fields (ship- to, sold-to, payer, and bill-to customer). I have one customer dimension table that joins to the sales fact table four times (once for each of the customer fields above). When viewing the data in Excel, I would like to have four hierarchies (ship -to, sold-to, payer, and bill-to customer) within Customer.
Is there a way to build hierarchies within my Customer dimension based on the same Customer table? What I want is to view the data in Excel and see the Customer dimension. Within Customer, I want four hierarchies.
View 2 Replies
View Related
Nov 17, 2004
i face a problem to create a new cube with the fact table without numeric field as a measure. can i use others data type of field as a measures?
anyone can provide me a solutions to solve it? thank you ..
View 1 Replies
View Related
May 6, 2015
i want to create cube withe 2 fact tables. is it possible?? if it is could you show me how !!
View 2 Replies
View Related
Apr 21, 2015
I have the following MDX query:
SELECT NON EMPTY {[DateT].[Year].[Year].Members } ON ROWS,
NON EMPTY { [Measures].[Val] } ON COLUMNS FROM [MyDB]
I need to order the data by year, so I tried this query:
SELECT
NON EMPTY { Order ( [DateT].[Year].[Year].Members,Desc) }
ON ROWS,
NON EMPTY { [Measures].[Val] } ON COLUMNS
FROM [MyDB]
But it doesn't work.
View 2 Replies
View Related
Nov 22, 2015
Is it correct to say that for each cube you can have only one Fact Table? I am having a funny dispute just now.
According my experience I never built cubes with more than one fact table, if I want take data from more than one table I write a view and I use it as Fact table...but a cube with two or three fact tables? Never tried..
View 3 Replies
View Related
May 23, 2007
Is there any Posibility to change a User Table to System Table.
How to create one system table.
I am in Big mess that One of the Table I am using is in System Type.
I cant Index the same. Is there any Mistake we can change a user table to system table.....
View 9 Replies
View Related
Oct 6, 2004
I have a big table with several types of transsactions: PO (Puchase Orders, SO,( Sales orders), INV (Invoices) ....
I want to create cubes with only one type of transactions (1 cube for PO,...)
Where and how can I filter the rows I want to use in my cube ?
Thanks
View 2 Replies
View Related
Nov 4, 2015
I tried using the page below but wasn't able to quite properly adapt it to my scenario
[URL]
I have two UNRELATED (can't be related for reasons outside the scope of this, other relationships already exist) tables.
Each table does, however, contain a WorkerID:
WorkerTimesheets:
WorkerID, HoursLogged, Date
3,10,2015-05-05
3,6,2015-05-10
4,8,2015-05-01
Then the unrelated table "ConstructionSites"
SiteID, SiteManagerID, SiteOpen,SiteClosed
A5, 3,2015-01-01,BLANK
What I want to do is be able to show a measure that SUMS the number of hours logged by anyone who is a SiteManager from the ConstructionSites table.
I wanted to do a SUMX of WorkerTimesheets against HoursLogged, but FILTER against WorkerTimesheets[WorkerID] = ConstructionSites[SiteManagerID] so only workers who are also SiteManager would be counted.However, I can't seem to get that to resolve it always throws an error along the lines that it can't determine context.
View 3 Replies
View Related
Aug 17, 2015
Is it possible to design a Cube with a Dimension "DimEmployee" (SCD Type2) and Query the following: What "title" had the person "xyz" at time "2015-01-01"? - See Example data on Images.
I have also a DimTime with Day granularity. The DimEmployee is not at day granularity.
View 9 Replies
View Related
Oct 5, 2005
Wonder if you could help me ?
I have set up a cube running under MSSQL Server 2000 Analysis services and have created reports in Excel 2002 using pivot tables and linking into the cube as an external data source.
The pivottable works fine and I can slice / dice as usual, the only thing that doesnt work is the drill through into AS. I receive and error message saying "Cannot show detail data for that selection...".
Now I know that the drill through works, as when I create a report using the Analsyis Services Excel Add Inthe drill through works fine, its just how do I get it working using the pivot tables ?
fyi - the reason I dont want to use the Analsyis Services Excel Add In for all the reports is because I have to deploy this to XX number of users, who wont have admin rights on their machines etc etc....
Is there any VB that I could use to perform this drill through and return the results.....or easier ??
Thanks very much
Mark
View 3 Replies
View Related
Jun 12, 2015
MDX query to get the source table and column for a measure from ssas database. i want below highlighted using mdx.
View 4 Replies
View Related
Jun 19, 2015
I need to extract data from SSAS' cubes into a SQL Server table.
I already read examples using Linked server (with openquery), SSIS, etc. However, the result always return as many columns per dimension as levels. I need to extract all members of a dimension in a column. E.g., when excecuting the following MDX query in Adventure Works 2014:
select [Measures].[Sales Amount] on columns,
Non Empty [Date].[Calendar].members on rows
from [Adventure Works]
I would like to get this result (MDX query in SSMS), but with keys displayed intead of names:
But I get this (MDX thru openquery or SSIS):
View 4 Replies
View Related
Jul 16, 2015
I am working with SSAS Tabular. I have a stand alone table with 60 columns and contains 120K records. Table size is 250MB. And trying to build a tabular report out of it and it is taking longer and throwing exception, screenshot attached.
It might be cross-join issues, as workaround created a dummy measure and using in report. But it working for 10-20 k records and beyond throwing same exception. I have 8 GB RAM and 100 GB free disk space.
Customer wanted it in SSAS Tabular...
View 3 Replies
View Related
May 11, 2015
I can pull a last processed date for the entire model: URL...That works great for showing the last time anything in the entire model was processed. It is not table specific. Updating / processing table A also changes the timestamp on tables B and C.However, if I want to look at just a specific table in the model (build a column for each fact table and a measure to go with it) I find that doing any process operation updates all the =Now() columns in all the fact tables.If I have a model with 3 fact tables and I do a process table using ProcessFull on one of them, all three tables calculated columns "LastProcessed" =NOW() are updated. URL...
Type>ProcessFull</Type>
<
Object>
<
DatabaseID>MyModel</DatabaseID>
<
DimensionID>TableA</DimensionID>
</
[code]...
Is there a way to setup a measure in the model on a per table level to show last processed date for each individual table? LastDataRefresh:= MAX ('TableA'[LastProcessed])
For example: Our sales table may update three times a day, where as our warehouse inventory table is only updated nightly.I wanted to let end users see by adding a measure for each table when the last process event was for a given table in the model.
View 2 Replies
View Related
Nov 12, 2015
how can I have a default filters in my Excel PowerPivot Table, without the user need to select them in Excel creating with DAX Language.
View 8 Replies
View Related
May 8, 2015
I am using a WriteBack Partition to receive data from various inputs and appends any new data that I add to the WB partition.
I am able to read the data immediately in the WB partition through a Fact partition query. This is working at this point as desired.
Eventually I want to move the data from the WB partition into Fact Partition. How can I do this, manually and through automation.
View 5 Replies
View Related
Aug 25, 2015
We couldn't find a way to show row/column members in the order as in the database. The Pivot table always applies alphabetical sorting:
Is there really no way to show items as per database order?
View 4 Replies
View Related
May 7, 2015
I have only 1 denormalized table that is being used in a SSAS Tabular model(which is about 3GB). I am doing a POC to convert it into a SSAS Multidimensional and explore it.
Table1
-----------------------
StoreName
StoreDesc
ItemName
ItemDesc
Qty1
Cost1
Price1
Amount1
1st Question) I am seeing that there is no Primary Key(unique key) in the current denormalized table. (Tabular Model didnt require any primary key). But i think for Multidimensional the key is mandatory? Should i generate a composite key myself in a Named Query based on this table(in the DSV)?
2nd Question) What is the best way to design my Multidimensional Cube/Dimensions based on this single table?
Say if i comeup with a Composite Primary Key called (PK_ID) . Should i be splitting up my facts / dimensions in my DSV using Named Queries similar to below(Using the same PK for my dimension tables also?)
a) FactTable = Select PK_ID, Qty1,Cost1,Price1,Amount1 from Table1
b) StoreDim = Select PK_ID, StoreName,StoreDese from Table1
c) ItemDim = Select PK_ID, ItemName,ItemDesc from Table1
Would this work?
View 3 Replies
View Related
Mar 5, 2015
I have, a SSAS 2012 tabular instance with SP2, there is a database on the instance with a read role with everyone assigned permissions. When configuring the Power BI analysis services connector, at the point where you enter Friendly Name, Description and Friendly error message, when you click next I receive the error "The remote server returned an error (403)." I've tested connecting to the database from Excel on a desktop and connect fine.I don't use a "onmicrosoft" account so don't have that problem to deal with.
We use Power BI Pro with our Office 365. As far as I can tell that part is working ok as I pass that stage of the configuration with a message saying connected to Power BI.The connector is installed on the same server as tabular services, its a Win2012 Standard server. The tabular instance is running a domain account that is the admin account for the instance (this is a dev environment) that account is what I've used in the connector configuration. It's also a local admin account. There is no gateway installed on the server.
View 10 Replies
View Related