Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI.
I'm trying to use this function to retrieve the firstsortedvalue of revenue expression, in a line chart, with Date and Customer dimensions.
Basically, I want the value to be the first one shown in the chart with respect to the other parameters chosen.
The overall idea here is to divide each month's revenue by the first sorted value's revenue, to achieve % change.
But I can't get the firstsortedvalue to work properly.
Here is my syntax, which clearly has problems because it does not retrieve any data.
=$(vPremiumRevenue) / FirstSortedValue($(vPremiumRevenue), [MonthYear], [Customer Name])
Any idea what I'm doing wrong here?
Thanks!
Actually, it retrieves data, but not anything for the firstsortedvalue. It only retrieves the actual (vPremiumRevenue).
FirstSortedValue expects 3 parameters
1) Value to be sorted
2) Weight of sorting
3) Ranking (1,2,3...)
You´re passing Customer Name as ranking parameter
Another point is if two values share same weight,NULL is returned, you have to choose a unique weight (maybe adding another field)
your expression looks wrong in terms of FirstSortedValue.
If possible, please attach your file for better solution
Unfortunately I can't attach the file. Work stuff.
I'm really a beginner to this -- just learning set analysis now.
How should I write the expression?
I have two dimensions in the line chart--MonthYear and Customer Name.
And one Expression -- the variable of vPremiumRevenue.
It's very simple right now, just showing each Customer's revenue per month/year
Anything else i could do instead of upload the file?
What output you want? Can you give one example in excel or table with sample data...
What do you expect? Maybe Max() or Min()?
If you want the first value, TOP($(vPremiumRevenue)) will retrieve it
Please have a look at this blog post.
This demo file has a good example of what I'm looking for.
It's really Revenue % Change over time.
So If the User selects 2013, and Jan-Dec, the chart will use January's Revenue as the firstsortedvalue, and the expression will divide each subsuquent calculation of revenue by that number.
As an example:
ABC, Co
Jan revenue = $150
Feb Revenue = $100
Mar Revenue = $200
So in the line chart, ABC Co. would show 100% for Jan, 67% for Feb, and 133% for March.
Feb and March calculations should be relative to the firstsortedvalue, which is the Jan revenue.
I don't know if i'm explaining this very well. But the linked doc shows it very close to what i need to achieve.
Thanks for the replies.