Substract as an aggregation rule for different level in a DIM ?!
Hi there..
I'm building a BI model based on financial transactions (incomes, expenses, etc..)
and my main problem is how to substract a measure, where the aggregation rule is set to SUM, for different levels in the "Account" dimension?
Example:
I have the "Account" dimension with the following hierarchy:
Account_ID / Account_name / Account_type / Account_total
And, lets say, 2 rows in it:
1.row in the "Account" dimension:
account_ID : 100
account_name : "Marketing expense"
account_type : "Variable expenses"
account_total : "Total profit" (total income - total Expenses)
2. row in the "Account" dimension:
account_ID : 200
account_name : "Financial incomes"
account_type : "Total incomes"
account_total : "Total profit" (total income - total Expenses)
"Total profit"
"Tot. incomes" "Tot. Expenses"
"Finan. incomes" "Market. expenses"
The fact table has just one measure: "Amount" and, of course, some foreign keys:
Account_ID -> "Account" dim
Organization_ID -> "Organization" dim
Date -> "Date" dim
Amount
The measure "Amount" in the fact table is positive both for expenses and incomes.
Now, what I'm trying to do is to sum up that measure on my top level in the "Account" dim.
At that level my report in Answers should substract "Total expenses" from "Total incomes"!
How can I do that?
thanks..
Ivan
Sorry to pop the obvious question, but can't you model that nicely and put it into distinct columns?
If not, you can create derived measures on you fact using "case when" statements. One for the incomes with amount > 0 (or >=0 ...depends on where you want to have the 0's) and one for the expenses with amount < 0.
HTH,
Chris
Similar Messages
-
How to define an aggregation rule for a dimension based on bridge table?
Hello,
I need a solution for aggregating data correctly when using a dimension based on a set of dimensione tables containing a bridge table. Please find below a description of my business case and the OBIEE model which I’ve created thus far.
Business Case
The company involved wants to report on the number of support cases, the different types of actions that were taken and the people involved in those actions. One support case will undergo a number of actions (called ‘handelingen’) until it is closed. For each action at least one person is involved performing a specific role, but there can also be multiple persons involved with 1 action, each performing a different role for that action. This is the N : N part of the model.
The problem that I face is visible in the two pictures below:
http://i84.photobucket.com/albums/k24/The_Dutchman_2006/OBIEE/sample.png
As long as I don’t include anything from the Dimension Meelezer in my report, I get the correct number of handelingen (7). When I include the person (called ‘Meelezer’), the measuere per action is multiplied by the number of persons/roles involved with that action.
When I changed the Aggregation rule in the report column #Handelingen to ‘Server Complex Aggregate’ I do get the correct endtotal:
http://i84.photobucket.com/albums/k24/The_Dutchman_2006/OBIEE/sample2.png
I believe it should be possible to define in the repository a different aggregation rule for individual dimensions, but I’ve not been able to achieve this.
Explained below is what I have created in my Physical and Business Model & Mapping layers:
The Physical Model is built like this:
(This is just a small part of a much larger physical model, but I’ve only included the most relevant tables)
http://i84.photobucket.com/albums/k24/The_Dutchman_2006/OBIEE/PhysicalDiagram-1.png
The Fact table (ALS Feit Zaakverloop) contains FK’s for the action (FK_HANDELING, joined to ALS Dim Handeling), the date the action took place (FK_DATUM_ZAAKVERLOOP, joined to ALS Dim Datum Zaakverloop) and the uniqe group of people involved (FK_MEELEZERS, joined to ALS Groep Meelezers) and a measure column (SUM_HANDELINGEN) populated with the value ‘1’ for each row.
The Bridge table (ALS Brug Meelezer/Reden Meelezen) contains three FK’s: FK_GR_MEELEZERS (joined to ALS Groep Meelezers), FK_MEELEZER (joined to ALS Dim Functionaris) and FK_REDEN_MEELEZEN (joined to ALS Dim Reden Meelezen).
The Business Model
In the business model, the four physical tables for the N:N relation have been combined into one logical dimension table.
http://i84.photobucket.com/albums/k24/The_Dutchman_2006/OBIEE/BusinessModel-1.png
DIM Meelezer contains one LTS in which the four physical tables have been combined:
http://i84.photobucket.com/albums/k24/The_Dutchman_2006/OBIEE/LTS1.png
And all the required locical columns have been created:
http://i84.photobucket.com/albums/k24/The_Dutchman_2006/OBIEE/LTS2.png
DIM Meelezer has also been identified as a bridge table and a Business Key has been defined on a combination of the FK’s in the bridge table and business codes of the two dimension tables.
http://i84.photobucket.com/albums/k24/The_Dutchman_2006/OBIEE/BMDIM.png
Next a hierachy was created for Dim Meelezer:
http://i84.photobucket.com/albums/k24/The_Dutchman_2006/OBIEE/Hier.png
In Feit Zaakverloop, a measurement called ‘# Handelingen’ was created using SUM_HANDELINGEN, with an aggregation rule of SUM.
In the LTS of both the DIM Meelezer and Feit Zaakverloop, the Logical Content Levels have both been set to: LVL Detail – Meelezer.
Please provide suggestions that will NOT require changes to the physical datamodel as they would require too much time to achieve (or at leats would not be ready before my deadline.
Thanks!
Edited by: The_Dutchman on Dec 13, 2011 11:43 AMHmm, no replies yet...
Am I in 'uncharted territory' with this issue? -
Aggregation rules for calculations
Hi
I have a calculation (logical column) Z as X*Y and I want Z to be an average at different levels in hierachy. How do I do it in OBIEE?Hi Siddharth,
Specifying Aggregation rule for a column in Admin Tool and applying Formula for a column in Answers work differently.
We usually specify Aggregation rule in Admin tool to implement the calculation measures. So, it will be used along with the logical levels.
Where as specifying Formula for a column in Answers works for that particular Request only..
Comes to its Significance...
Take the general example... Sales by Country, Region, District and City
To calculate the total sales Country, Region, District and City wise we specify aggregation rule as SUM for the Amount column..
In order to calculate the logical level wise details we use Aggregations..i.e., Measures..
For last question, is your saying the use of 'Use Existing Logical columns as the Source'..
In this case, I think it is not possible to specify the Aggregation rule in Admin tool.
-Vency -
The reasoning behind aggregation rules at report level
Hello guys
I notice that in the answer criteria, we can define column formula of each columns in the request, but we can also set aggregation rules for the numeric columns..
I'd like to have a deeper understanding on how these settings work..
The Avg, Max, Min, Count are pretty clear and self-explanatory to me.
My main question is the difference between 'default', 'Server determined', 'complex server aggregate', and 'Sum'.
In a lot of the measure columns when the aggregate rule is 'default', when I do subtotaling in report views, I would actually get the right total amount by dimension columns, however there are also places in the report where the sub total is off, so I have to go and set the aggregate rule of that measure to 'Sum' then the total becomes correct 100%. When I try 'server determined', 'complex server aggregate', some measures change and some don't, but this is not in a pattern of change that I can understand the concept behind. The OBIEE documents said very little about this part
So is there more detailed information out there that explains more about what these options are doing?
Thanks in advanceHi Shruthi,
To be clear you have one table 'DIM_LF_B' and its separated out as FACT and DIM in BMM layer with respective formulas ? If yes check this http://www.varanasisaichand.com/2012/04/fact-and-dimension-from-single-source.html
let me know if it is different
Thanks,
Saichand -
[SOLVED] how to use diffrent iptables rules for different ppp account?
x86 plantform run arch linux system , have two network interface etn1 eth0 .eth1 connect to internet. eth0 connect to other terminals through switch. want use different iptables rules for different pppoe account .also want to know how to forbidden more than one terminals established pppoe link use same account at the same time .
Last edited by linuxsir (2013-09-26 06:48:01)(You establish PPPoE sessions over the local network to the Arch machine? Which then routes the traffic?)
first question ,yes that is exactly what i am done. second question i also have a small scripts on windows pc to solve routes traffic problem
route -p delete 0.0.0.0
route -p add 192.168.9.0 mask 255.255.255.0 192.168.9.1
route -p add 0.0.0.0 mask 0.0.0.0 192.168.22.0
but after a while i found scripts is not necessary because windows always attempt to use PPPoE sessions as default internet connection local connection is also ok
and use -i pppX in my iptables rules dose not solve my problem , because same account start PPPoE session could be marked as ppp0 or ppp1. it is hard to identified which account start session. -
Leave Quota generation with diifferent rules for different countries
Hi,
I have the following requirement need help in achieving this.
Employers must grant 10 days paid leave to employees that worked for six consecutive months from the time of hiring and who worked on not less than 80 per cent of all schedule work days. This paid leave may be taken consecutively or separately. Where an employee's application to take paid leave will hinder the normal business operations, the employer may require the employee to take such paid leave at a different time.
The number of days of paid leave available to employees increases in proportion to employees' length of service as set forth in the below table.
Years of Service 0.5 1.5 2.5 3.5 4.5 5.5 6.5+
Paid Holidays 10 11 12 14 16 18 20
The right to annual paid leave expires after two years. In other words, annual paid leave left over from one year may be carried over and taken the next year only. For example, if an employee is awarded 10 days paid leave after their first 6 months of employment; those paid holidays will become invalid after 2.5 years of employment. Use them or lose them.
Simply put, holidays from one year can be carried over to the next year, but not to the third year. So, if you don't take your leave from one particular year within 12 months of that year ending, you will lose that first year's allowance.
Employee can take leave encashment of holiday leave only when leaving their employer. It is not legal for companies to buy up the holiday leave of those still working for the firm.
In my organization one PSG grouping has been used for all countries, it wont be possible to change the grouping now. In such a case how can we provide different rule for different country without customizing the Leave module.
Do we have to use any PCR for this, if yes which??
Regards,
Jailakshmi
Edited by: Jailakshmi on Aug 3, 2011 7:16 AMHi,
Use QUOMO Feature to give different entitilement to employees.
Leave entitlement as per seniority can be configured in base entitlement.
Keep validity and deduction period for 2 years by using :Relative postion" option in validity and deduction period table.
Rgds,
Lata
Rgds, -
How to Define Multiple Notification Rules for Different E-Mail Channels?
In C4C we can define a notification rule for New tickets, for example, that provides an acknowledgement of receiving the customer's e-mail.
This works great for a single support team, but what if we have multiple support teams, each with their own e-mail address, and each with unique requirements for their auto-acknowledgement?
When setting up a new notification rule, there doesn't appear to be any option to define the e-mail channel, service and support team value, or a "from" e-mail address.
We're on-boarding over a dozen e-mail teams, and I'd hate to tell them that they'll all have to share one auto-acknowledgement template from a single do-not-reply address.
Does anyone know if this is possible to:
Define the e-mail channel or service and support team as an condition in the notification rules.
Define the outgoing "from" e-mail address for a notification rule.
Thanks for any insight the community might have!
Mike
T-Mobile USAHi Mike,
As of release 1402, your analysis is correct. The out-of-the-box notification rules do not include the "incoming email channel" as one of fields on which to build condition, and all notifications are sent from a common do-not-reply address.
You can easily overcome the first limitation by using the SDK. For example, when the ticket is created you could set an extension field based on the email channel, and then use the extension field to define different notification rules, using different templates. All extension fields are automatically available to be used as conditions.
Thank you for your feedback and for bringing this item to our attention. We will definitely keep this in mind as we plan for future releases.
Kind regards,
Gabriele Bodda
Product Management -
10:1 rule for skip - level aggregation
Hy.
I'm new in OLAP. I'm using AWM on 10gR2 and could somebody explain to me what does mean 10:1 rule. I know that is ratio of children to parent level which is 10:1, but example that i study doesn't show me that.
Example:
(from Oracle 10g documentation, data warehousing, OLAP Application Developer's Guide, part 7 Aggregating Data, Case Study: Aggregating a Moderately Sparse or Dense Cube)
SELECT COUNT(DISTINCT ship_to_id), COUNT(DISTINCT warehouse_id),
COUNT(DISTINCT region_id),COUNT(DISTINCT total_customer_id),
COUNT(DISTINCT account_id), COUNT(DISTINCT market_segment_id),
COUNT(DISTINCT total_market_id), FROM global.customer_dim;
Global is a very small data set, so few adjacent levels have the desired 10:1 ratio of children-to-parent dimension members. Table 7-4 and Table 7-5 identify the appropriate levels to be calculated and stored for the two hierarchies. Only eight members are stored out of a total of 45 aggregate members.
On the Summarize To page for the Units Cube, select the precalculated levels for Customer, and select all levels for Time, Product, and Channel.
Table 7-4 Precalculated Levels in the Customer Shipments Hierarchy
Level Members Precalculate?
Total_Customer 1 No
Regio 3 Yes
Warehouse 11 No
Ship_To 61 Yes
Level Members Precalculate?
Total_Market 1 No
Market_Segment 5 Yes
Account 24 No
Ship_To 61 Yes
If I use rule 10:1 child to parent member why Warehouse and Account doesn't have precalculate set to Yes If they have 10 or more child values below.
Please help!!!!It is a long time since I used the global schema and at the moment I am using the BI common schema so I am trying to quote from memory here regarding the data. The figures you have outlined below are number of members at each level, a better calculation would be the average number of children that would be returned when drilling from one level to the next. In this case there are 3 regions and 11 warehouses, so drilling from region to warehouse is likely to return at most 4 warehouses on average.
To quote from the OLAP documentation:
This 10:1 rule is best applied with some judgment. You might want to permit a higher
ratio for levels that you know are seldom accessed. Or you might want to store levels
at a lower ratio if you know they have heavy use.
The key for pre-aggregation is understanding expected usage patterns of your users. In this case for the global schema I expect it is optimised for demo purposes and the levels that are precomputed are those most likely to be used in a demo.
In your case you need to understand where your users will most likely start there analysis and make sure that combination of levels is precomputed to ensure fast response times for the first query and then monitor usage patterns and get feedback from users over time.
If you are using Discoverer OLAP Plus client you could export the Discoverer catalog and analyse the XML for each report to determine which values are being created. I don't think there is an easy way to monitor OLAP queries at the moment (I could be wrong but I have not seen anything in Enterprise Manager that would help in this area). You could quickly create a program in PL/SQL or OLAP DML that would help analyse the XML for Disco reports. If you are using BI Beans you can scan the XML from the BI Beans catalog for each report.
For the OLAP Spreadsheet Addin it might be necessary to create a program to scan the $V_SQL/V$SESSION tables to work out which data points are being requested by users.
Of course you could just try pre-computing every other level which I think was/is the default aggregation plan generated by OWB and AWM.
Hope this helps
Keith -
Different aggregate rule for different measures?
Hi.I have an outline with two members in measures dimension:Activity and Profit. Other dimensions including Period,Account,Area,Cost Center etc.The customer require the Activity measure to be aggregated on all dimensions. But as the Profit measure, when Period and Account members are the same, the Profit value on the level 0 member of Area and Cost Center will be either #Missing or an equal number. And the aggregate rule on Area and Cost Center,while Period and Account members are the same, should be to copy one none-missing value(if exists) to the upper level member.For example,if Area has three children:area1,area2,area3. When fixing Period Account and Cost Center,the Profit on area1 is 15,area2 is #missing,area3 is 15. Then the Profit on Area should be 15. So is on the dimension Cost Center.How can I design a formula or a calc script to do it?Thanks!
What I found in Oracle presentation is that in 10GR2 compressed cube enhancements support all aggregation methods except weighted methods (first, last, minimum, maximum and so on). It is from September 2005 so maybe something changed since then.
Regarding your question about the results I think it is caused by the fact that calculation are made on doubles and then there is a compression, so maybe precsion is lost a little bit :(. I really am curious whether it is because of numeric (precision loss) issues. -
BEx Analyser: How can I define colours for different levels of a hierarchy?
Hi everyone,
I have a report in BEx Anaylser that includes a hiearchy of 9 levels.
For a better overview, I want to define different colours for the cells of each level. In this way, the user should be able to see which numbers belong to which hierarchy level. How can I do this?
Best regards
DanielDear Anujit,
Thanks for your answer.
Seriously? I cannot do this with BEx Analyzer other than using Excel VBA macro?
Cheers, Daniel -
ACE: Different Sticky rules for different URLs
Is there a way to apply different sticky rules (or no sticky at all) depending on the URL for a given site under ACE?
The reason I want to do this is because I have an extremely common URL that chews up sticky resources when it doesn't matter if the URL is sticky. We have several thousand PC's that have a web based screen saver on them that just pull random pages to be displayed on the users' screen when the screen saver kicks in. These pages do not need to be sticky but other pages on the same farm need sticky. Is this possible?
CaseyCreate a more specific Layer 7 class map and instead of calling sticky serverfarm use serverfarm.
for example
sticky http-cookie COOKIE STATIC
cookie insert browser-expire
timeout 5
serverfarm WEBFARM
serverfarm host WEBFARM
rserver SV1 80
inservice
rserver SV2 80
inservice
class-map match-any APP1-VIP
2 match virtual-address 10.86.178.160 tcp eq http
class-map type http loadbalance match-all Condition1
2 match http url .*
3 match http header Host header-value 172.16.31.*
4 match http header User-Agent header-value .*MSIE.*
class-map type http loadbalance match-all Condition2
2 match http url .*
policy-map type loadbalance first-match L7_COOKIE_STATIC
class Condition2
sticky-serverfarm STATIC
class Condition1
serverfarm WEBFARM
policy-map multi-match CLIENT_VIPS
class APP1-VIP
loadbalance vip inservice
loadbalance policy L7_COOKIE_STATIC
loadbalance vip icmp-reply active
loadbalance vip advertise active
Syed -
Setting aggregation content for logical level in 11g
Hi Guys,
When working on with horizontal and vertical federation in OBIEE 11g with multiple data sources here in my case it is essbase and RDBMS.
1) pulled the columns and dragged into the concerened table.
2) The related heirarchies have been defined.
3) when trying to go to one of the LTS and trying to set the logical level aggregation im not able to see the levels columns corresponding nor im getting the get levels option to get them. where am i going wrong?
when im trying to join a fact by pulling it on to the fact...i can see the levels in content tab,but when i try to define levels and check it its giving me error "There are no levels matching the BI algorithm"
Any answers wud be appreciated.
TIA,
KK
Edited by: Kranthi.K on Sep 5, 2011 2:52 AMIt is autocreated,i dint customize it.....Im dropping the RDBMS table onto the Essbase cube dimension table and im not getting the RDBMS content levels that should be defined in the LTS of the table,and the RDBMS table has an level based hierarchy but still no sucess.
Any more ideas
UPDATED POST
Deepak,it was not helpful as i have gone through tht document before....Im trying it in all scenerios to figure out where actually it is going wrong.
If i dont find the path,i will let you kne what im trying to do so you can help me out.
UPDATED POST-2
Any more pointers from the experts.
Edited by: Kranthi.K on Sep 6, 2011 7:01 AM -
How to create different log files for different levels
Hi,
Can some one please help me with my problem I have here?
I want to send log data to two diffrent files depending on the logging level such as DEBUG and WARN using the same logger instance.
How can you configure this in log4j.properties.
Please post sample code for log4j.properties to achieve this.
Thanks in advance.
Anurag SInghHi,
I have tried your code. the issue is other log file for error is blank. its not writting log to that file.
following is the code of my log4j.properties
Please read the code first
# Set root logger level to DEBUG and its only appender to A1.
log4j.rootCategory=DEBUG,A1
#Appender and its layout for A1
log4j.appender.A1=org.apache.log4j.FileAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %log4j.appender.A1.Threshold=DEBUG
log4j.appender.A1.File=./LogonApplication_Debug.log
log4j.appender.A1.Append=true
#Appender and its layout for A2
log4j.appender.A2=org.apache.log4j.FileAppender
log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %
log4j.appender.A2.Threshold=ERROR
log4j.appender.A2.File=./LogonApplication_Error.log
log4j.appender.A2.Append=true
In my logger class i have written something like this:
public static Logger myLogger = Logger.getLogger (LoggerTest.class.getName());
public static void main(String args[]){
myLogger.debug("I have logged a debug message");
myLogger.error("I have logged an error message");
Issue:
Now the problem is that it is creating two files specified in the configuration but it is logging messages both the messages debug and error in only ./LogonApplication_Debug.log file.
Though it is creating the ./LogonApplication_Error.log file, but it is only blank.
Can you please trace whats missing/wrong.
Thanks a lot.
Shanu -
Display different level for same hierarchy value in BO 4.0
Hi Expert,
I have one question for Webi for BO 4.0
We have one hierarchy in BW side and we hope to display differet level in same report for different column
For example, column A is for level 6. column B is for level 7.
Do you know how to releaze this in Webi side?
In the 3.X version, we have different dimension for different level.
But now in BO 4, it has been combined into one\
Thanks and best regards
Alex yangHi,
You can still do this in BI 4.0, if you use the old 'legacy' MDX OLAP.unv from Universe Designer tool .
Yes, with the BICS connection, you are getting a native hierarchy, as it would be displayed in an OLAP environment.
Cheers,
H -
I have a fact table which contains sales order lines. Also in this is fact is reserved stock which will be used to fill those sales order lines. Each sales order lines can be fulfilled from multiple stock locations. Thefore, I have a fact table that resembles something like this for a single order line:
Order Line Number, Order Line Quantity, Stock Lot Number, Reservation Quantity
ORD_LINE1, 35, LOT1, 10
ORD_LINE1, 35, LOT2, 17
ORD_LINE1, 35, LOT3, 8
My problem is that the Order Line Quantity measure, when totalled in OBIEE is giving me 105 (35*3) - when it needs to be 35.
How can I show a total of 35 for Order Line Quantity, at the same time as showing 35 for Reservation Quantity?
My underlying SQL query is very performance sensitive so would like to stay away from analytical functions. Is there something I can do with hierarchies?
This is OBIEE 10g
Edited by: 934462 on 06-May-2013 03:09
Edited by: 934462 on 06-May-2013 03:15It looks like your quantity only depends on order line number while "reserved" measure is dependent on lot and order line number. So, you have combined measures of two different grains in the same table. You can do following:
1. Address the problem at the database level by splitting this into two separate facts and model them as two logical facts connected through a single dimension order line number. This is cleaner and it should run faster.
OR
2. You can copy ordered quantity as a new logical column but do not set any aggregation rule. Bring it into presentation layer and use it as a common attribute of order line in your report. Since this column would be part of group by, it may sacrifice some performance.
OR
3. In the ordered quantity measure, go to aggregation tab, check "Based on Dimensions", in the new list, choose MAX() as the aggregation rule for Order lines dimension (create a logical table and associated dummy hierarchy of sales order line attribute if you dont have them) and SUM() as aggregation rule for stock location dimension. This is slightly experimental, I doubt how much it would help in your scenario.
Maybe you are looking for
-
Can I transfer my existing Photoshop Single App subscription to your new offer of both PS & LR
Hi, I see on your site that I should be able to cancel my existing membership and start with your offer of both Photoshop and Lightroom for under £9 per month. I originally wanted both software packages but couldn't afford both so only have Photoshop
-
Adobe 11 Installation: Cannot Open PDF Files
I have iMac 10.6.8. OSX SnowLeopard. Downloaded Adobe 11 to be able to access transcripts. Successful install of Adobe achieved. Trying to open a PDF document that is sitting in my download file with transcripts and the screen keeps going back t
-
Dear Gurus, I need to set ABC indicator as per my client requirement They want A to be counted 3 times for 3 years B to be counted 2 times for 3 years C to be counted 1 time for 3 years. Please suggest me, how to implement this Regards RS
-
Dear all, I'm facing a strange problem. This morning my WD worked well. I changed my specific table used in the WD (added new fields). My context is on this table. I update all my views with this context. I have 2 methods which used the specific tabl
-
HTTP send returned with status code(100,101)
Hi Experts, I am facing an error in ADS at se38 --> FP_PDF_TEST_00 Test Program: Version Information (for Analysis Only) SYSTEM ERROR ERROR CODE : 100,101 ERROR MESSAGE : SOAP Runtime Exception: CSoapExceptionTransport : HTTP send returned with