Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I have a table which contains some conditional dimensions and expressions. One of the expression is market share, I am using the following expression for market share:
sum(sales)/sum(TOTAL<Dimension>Sales)
I am getting correct market share but lets say i increased the dimensions from 3 to 10, then if i go by the above fromula then i will have to write all the 10 dimensions in the angle bracket.
Is there any other method to calculate market share? Please help guys..................I am attaching the data file and the qvw file for the reference...........
Nope, you'll have to add the dimensions to the expression. Unless you want to precalculate the shares in the script. That's going to be a bit messy though. It's certainly not less work.
Thanks Gysbert for the Reply.
But i have a small doubt on that also. Lets say I put 10 dimension in the formula and i select only four dimesnions, will that give me correct market share?
Let's say my expression for the market share is:
Sum(sales)/sum(TOTAL<Dim1, Dim2, Dim3, Dim4, Dim5>Sales)
and my current selection is:
Product
Dim1
Dim2
Dim3
Market Share
Will it show me the correct market share?
You can use a string that contains a list of selected dimensions, for example in a variable DimensionList. Or function GetFieldSelections, if your dimensions don't contain spaces. Your expression would be
Sum(sales)/sum(TOTAL<$(DimensionList)>Sales)