Adding a Standard Deviation Measure,Removing by range - ssas

In a Easy Cube layout i have a Product and Time dimension
my transaction cube has the unitary price of the product and the total value(quantity x unitary price)
sometimes when i got a product promotion(like :buy 2 get 3) we have the unitary price equal $0,01 for 1 record.
i want to remove from my average, maximum and minimun [measures] results all these records( $ 0,01)
i thinking about a standard deviation implementation, but this only work with my already set measures
i tried to add unitary price with a no aggregation measure (which would suit me) but i'm using standard edition
(and 'no aggregattion' its not available as measure type)
thanks for your time, sorry for my english
Arthur
Sao Paulo - Brazil

The better approach (the MDX way) would be to add an attribute, say "On promotion" with members "Promo" and "regular".
Then just by either not using the attribute (and hence using the All member, which aggregates "Promo" and "regular", you get all measures including the promoted products, or by using just the member "regular" in a filter or in the rows or columns, all measures would include only the regular products.
There are approaches for implementing this using your current cube model (probably using Filter), but they are complex to implement and slow.

Related

Wrong SUM calculations in OLAP cube

I'm pretty new to SSAS and i have encountered a quite odd issue. The simple SUM function in OLAP cube shows wrong numbers based on the dimension usage.
I have created simple OLAP cube in SSAS, which tracks fuel payments across company car fleet. Data source is a SQL database server, and I use table "purchase" (contains information of amount of fuel bought, paid price, location of purchase etc.) as a measure and tables "car" (information about car type, its registration ID etc.), "location" (plant location the driver originates from) and "division" as dimensions.
When I first connected all dimensions to the measure on the "Dimension usage" tab, I got wrong sum of the price paid and amount of fuel bought - the sum displayed was much lower than the actual one. I tried to look into it and the numbers were wrong as well if i looked at the data by division, location etc.
But when I used the "Car" dimension and created table showing the data for each individual car, the results were correct, which I find weird.
When I disconnected the "Car" dimension from the measure group, the totals in the cube were correct, but i was (of course) unable to look at individual numbers for each car.
I understand that there is some problem with the "Car" dimension, but I am unable to find out what exactly goes wrong. Any advice helping me to identify where to look would be much appreciated. Thanks in advance.

MDX filter on fixed value depending on hierarcy level

I need to build a named set with mdx which tells me for a whole year what which are the large records. I cannot share my data, so I'll use a sales example.
All sales reps. need to enter their sales numbers in a application and on top of that database there is a cube configured. One of the goals is to find weird sales behaviour in this cube. This would mean a sales rep that is selling 100k every year, suddenly only sells 30k a year.
I have created a dynamic set that allows me to filter on this by using a calculated member named 'qualifies'. This qualifies is defined like this. (Diff is calculated before)
CREATE MEMBER Currentcube.qualifies AS iif(abs([Diff]) > 50000, 1, NULL),DISPLAY_FOLDER = 'Check big difference';
So this check can be used to filter all the sales reps that have a difference of 50k sales.
When I add aonther filter to my cube, for example region, the 50k threshold will never be exceeded, because no body has more than 50k sales in one region. I want to make the 50K dynamic based on my where clause in my filter.
My question is, is this possible? I'm fairly new to MDX so if this is an easy question, please forgive me. I have been trying lots of different scenario's but none gave a wanted result. I have been looking online, but this specific scenario hasn't passed in my search results.

display always the right MDX (sub)total in the client-application (eg Excel)

I can't figure it out! (CustomRollUpColumn??, or some custom made MDX calculated thing)
My problem: I have a dimension TypeOfRow who's function it is to display the ... well yes ... type of row. I'm working in the financial sector and, always, need to provide the ultimate result ==>> The Total Contribution. I read, amongst others, the article of Martin Mason ( http://martinmason.wordpress.com/2012/02/26/the-ssas-financial-cubepart-1ragged-hierarchies/ ) and designed the dimension as a "Naturalized Parent-Child Hierarchy".
The dimension, 5 levels, I designed for this solution is (simplyfied):
•+/+ Revenue (several types of)
•-/- Cost (several types of)
•= Total Contribution
A user requirement is that the "Total Contribution" always display the "Total Contribution" even if any the Revenue- or Cost types are filtered out.
My question: is this possible showing the total of a dimension without showing all the members (in Excel but I hope to configure this in SSAS 2008R2)?
many thanks in advance, - Leon

Calculate prorata share with MDX

I have a SSAS cube that shows Investors and their investment value in funds. The fund value and prorata shares are in fact table. I've created a calculated measure that simply multiplies fund value * share. The problem comes in the Total line. The row marked as WRONG is what shows now. The row marked RIGHT is what I want to show.
Investor Fund Value Share Investor Value
Investor 1 100,000 0.4 40,000
Investor 1 200,000 0.3 60,000
Total 300,000 0.7 210,000 <== WRONG
Total 100,000 <== RIGHT
Max answer is the way to go if performance might be a problem (precalculation). It's possible to solve the prorarta using MDX Calculated members (performance might be an issue if your dimensions are big).
The issue to go further into this solution is I need a dimension where the 100'000 and the 200'000 Fund Values are difference (e.g. [Share] .). Can you describe your dimensions ?
I know this is a few months old, but I would use a scope statement to overwrite that cell with the correct calculation. Check this out: http://www.bidn.com/articles/mdx-and-dmx/94/mdx-scripting-with-scope-statement To view the article requires a login, but its free.
Simplest way: create new calculated field (write an expression) in DSV (in the corresponding fact table) of your olap DB. And after that use this field in the measure (aggregation type SUM).

SSAS - Need to have a calculated member that uses as a denominator one particular dimension value

I have a cube that I built in SSAS for general ledger data. The cube uses 2 fact tables. One for accounts that are "normal" dollar based accounts and the other is for unit / statistical accounts - accounts that count ANYTHING, except for money usually.
I need for one calculated member in SSAS to be ANY of the "normal" dollar based accounts divided by ONLY one particular dimension of the statistical accounts.
If clear as mud - let me give the specific example. There is an statistical account called Gallons (measure is units) and there are many accounts such as sales, depreciation, tax expense, etc that are the "normal" G/L accounts (measure in dollars). I need to have the cube be able to report on ANY of the "normal" G/L accounts DIVIDED by Gallons (so that any of the normal revenue / expense accounts can have a measure that shows BY GALLON.)
I have no clue how to write the MDX to do this (the function to use and / or the syntax) and I have tried many times and researched quite a bit (I am a SQL person - FAR from a MDX person I guess!). I'm thinking I need to use FILTER but I'm not even sure that is the right direction.....
Little unsure with your design ,If you are having trouble with MDX you can create a calculated member in DSV using T-sql