Connor Moore Posted June 19, 2019 Share Posted June 19, 2019 I am trying to calculate the percentage of sales a salesman has in a particular city. I have another visualization that I would like to drive this calculation for whichever salesman I select.See example below with problem and commentary following. Example Data Set Salesman City Amount of Sales Opportunity (Calculate in Custom Expression) Market Share (Calculate in Custom Expression) Tim Chicago 50 400 25% Tim Chicago 50 400 25% David Chicago 300 400 75% Kim New York 600 1000 60% Tim New York 400 1000 40% Scatter Plot Visualization Y-Axis ="Opportunity" Custom Expression = Sum([Amount of Sales]) OVER (All([Axis.Marker])) X-Axis ="Market Share" Custom Expression = Sum([Amount of Sales]) / Sum([Amount of Sales]) OVER (All([Axis.Marker])) Color by = "City" Marker by = "Salesman" What I want to see when I select Salesman = Tim in driving visualization and hover over City = Chicago data pointin scatter plot: Y-Value (Opportunity) = 400 X-Value (Market Share) = 25% Instead what I see is: Y-Value (Opportunity) = 100 X-Value (Market Share) = 100% As you can see, it only takes the sum of the sales that Tim has and uses that as the Opportunity; neglecting to include the other 300 of sales that David has. Thus when you divide the the numerator (=100) by the denominator (=100) the Market Share = 100%. It is worth noting that if I do not select anything in my driving visualization (where I would select 1 or more Salesman), the scatter plot correctly displays what I want for all Salesman. Link to comment Share on other sites More sharing options...
Connor Moore Posted June 19, 2019 Author Share Posted June 19, 2019 Apparently the table tool works great when posting... The 5 titles above the table are the headers; sequentially applied left to right from the list. Link to comment Share on other sites More sharing options...
Khushboo Rabadia Posted September 13, 2019 Share Posted September 13, 2019 That is because you have selected to limit data by marking in other visualization. So once you mark any salesman in other visualization, only data related to that salesman will be shown (similar to drill-down functionality). As only Tim's data is flowing in visualization, expressionscalculated would be incorrect. You can achieve your requirement through the use of data function. You can trigger data function on marking change which will set document property value to salesman marked instead of limiting visualization using marking. - Remove limit data by marking from scatter plot - Create data function as mentioned in below article: You can insert simple script which copies input to output document property op Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now