Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to show the comparison between two companies, let's say Acme and whatever company the user selects, in a trellis chart that sums Sales by Region and Product.
The hard part is that I want Acme to always be one of the companies, and the other company to be whatever the user selects. Does anyone know how to do this?
Ideally the chart would look like this, where ACME is always the first company regardless of user selection.
And here's the script I used to generate the data:
Table:LOAD if(recno() / 9 <= 1, 'Product A', if(recno() / 9 > 1 AND recno() / 9 <= 2, 'Product B', if(recno() / 9 > 2, 'Product C'))) AS Product, if(mod(floor((recno()-1)/3), 3) = 0, 'Texas', if(mod(floor((recno()-1)/3), 3) = 1, 'California', if(mod(floor((recno()-1)/3), 3) = 2, 'Georgia'))) AS Region, if(mod((recno()-1), 3) = 0, 'Acme', if(mod((recno()-1), 3) = 1, 'Company A', if(mod((recno()-1), 3) = 2, 'Company B'))) AS Carrier, rand() * 1000 AS SalesAUTOGENERATE 27;
Thanks to anyone who can help!
In the chart options
use Region as your dimension
Then in your expressions tab, use something like this to limit it only to Acme:
sum({$<Carrier={"Acme"}>} Sales)
It looks like you used Product for your dimension.
Dimension is your x-axis on the chart.
On your original posting you have it listed by region. Now to limit the data to the companies, you do so in the expressions tab or by limiting it in your script. Which since you want to compare the data, it's easier to limit it in the script.
To replicate your chart from your original post, you can use Region as your dimension in your expressions tab, the following three expressions:
sum({$<Carrier={'Acme'}, Product={'Product A'}>} Sales)
sum({$<Carrier={'Acme'}, Product={'Product B'}>} Sales)
sum({$<Carrier={'Acme'}, Product={'Product C'}>} Sales)
Basically, the expressions are saying take the Sum of sales where carrier = acme and where product = specified product. With the data limited it will assign it to it's corresponding dimension.
Is that what you were asking? If you can view it, I uploaded what I think you're referencing.
Bryan,
Yes, that is what I want, but all as one chart so that it will minimize/maximize all at once (instead of having to minimize/maximize them as two separate charts). The only way I can think of to do this is as a Trellis chart. Do you know how to do it all as one chart?
Well to turn it into a trellis, I went to the dimensions tab, and clicked on the trellis button on the lower left, checked Enable Trellis Chart, hit OK.
Then I set the Dimension fields as Carrier and Region (in that order).
then for expressions:
sum({$<Product={"Product A"}>} Sales)
sum({$<Product={"Product B"}>} Sales)
sum({$<Product={"Product C"}>} Sales)
Still trying to figure out how to make Acme show at all times though.
I've been looking around and I can't find an elegant way to make always show Acme.
However, I did find a solution of the sort.
If you go to the corresponding list box, go to Selection Style Override and select either Windows Checkboxes or Corner tag. I think this is probably the most obvious way to show an end user they can keep Acme selected without explaining you can press ctrl to select multiple options.
Perhaps someone knows of a better way to keep one value always selected.