![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Create 3 dimensions: AccountNum, AccountName, and Date joining to those 3 columns. Then define 2 measures (having Sum aggregation function) with these Source Columns: Credit>> case when Fact.Amount > 0 then Fact.Amount else 0 end Debit>> case when Fact.Amount < 0 then Fact.Amount else 0 end - Deepak *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#4
| |||
| |||
|
|
Thanks for your assistance, I have followed your instructions however, both positive and negative values are being added to both Credit and Debit. Any further ideas? "Deepak Puri" <deepak_puri (AT) progressive (DOT) com> wrote in message news:e2Ii1PqIEHA.3432 (AT) tk2msftngp13 (DOT) phx.gbl... Create 3 dimensions: AccountNum, AccountName, and Date joining to those 3 columns. Then define 2 measures (having Sum aggregation function) with these Source Columns: Credit>> case when Fact.Amount > 0 then Fact.Amount else 0 end Debit>> case when Fact.Amount < 0 then Fact.Amount else 0 end - Deepak *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#5
| |||
| |||
|
|
case when Fact.Amount > 0 then Fact.Amount else 0 end then ONLY positive amounts will be summed under Credit. |
|
case when Fact.Amount < 0 then Fact.Amount else 0 end then ONLY negative amounts will be summed under Debit. |
#6
| |||
| |||
|
|
From what you are describing, you may not have defined the "Source Column" SQL expressions as explained below. For example, if "Source Column" expression for Credit is: case when Fact.Amount > 0 then Fact.Amount else 0 end then ONLY positive amounts will be summed under Credit. And if the "Source Column" expression for Debit is: case when Fact.Amount < 0 then Fact.Amount else 0 end then ONLY negative amounts will be summed under Debit. Of course, I'm assuming that you are using a relational data source (such as SQL Server) which implements case. You can follow the other suggestion, and create a new fact table/view with 2 columns for Debit/Credit, if you prefer. - Deepak *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#7
| |||
| |||
|
|
You have to create a fact table that has 2 columns! create a fact table with 2 select statements like: select AccountNum, AccountName, Date, Amount as Debit, null as Credit from table where amount > 0 union all select AccountNum, AccountName, Date, null as Debit, Amount as Credit from table where amount < 0 and this is your fact table, and you have 2 basic measures! Simple as that! hope it helps! Peace, Andrej "AshVsAOD" <.> wrote in message news:%23WWXaNrIEHA.2480 (AT) tk2msftngp13 (DOT) phx.gbl... Thanks for your assistance, I have followed your instructions however, both positive and negative values are being added to both Credit and Debit. Any further ideas? "Deepak Puri" <deepak_puri (AT) progressive (DOT) com> wrote in message news:e2Ii1PqIEHA.3432 (AT) tk2msftngp13 (DOT) phx.gbl... Create 3 dimensions: AccountNum, AccountName, and Date joining to those 3 columns. Then define 2 measures (having Sum aggregation function) with these Source Columns: Credit>> case when Fact.Amount > 0 then Fact.Amount else 0 end Debit>> case when Fact.Amount < 0 then Fact.Amount else 0 end - Deepak *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#8
| |||
| |||
|
|
Thanks very much for all your assistance. My knowledge of OLAP and everything surrounding the tech is growing but still very light on. I recreated the cube a second time using your described method with success. I must have mispelt something or other. I really do appreciate your help. Kind Regards Clint "Deepak Puri" <deepak_puri (AT) progressive (DOT) com> wrote in message news:etL4irxIEHA.2236 (AT) TK2MSFTNGP10 (DOT) phx.gbl... From what you are describing, you may not have defined the "Source Column" SQL expressions as explained below. For example, if "Source Column" expression for Credit is: case when Fact.Amount > 0 then Fact.Amount else 0 end then ONLY positive amounts will be summed under Credit. And if the "Source Column" expression for Debit is: case when Fact.Amount < 0 then Fact.Amount else 0 end then ONLY negative amounts will be summed under Debit. Of course, I'm assuming that you are using a relational data source (such as SQL Server) which implements case. You can follow the other suggestion, and create a new fact table/view with 2 columns for Debit/Credit, if you prefer. - Deepak *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
![]() |
| Thread Tools | |
| Display Modes | |
| |