Hi Priyesh ,
Mainly you were facing two issues while doing so -
1.While writing the calculation as one of your field is aggregated and another one is non aggregated .
try solving it with this ::
2. Once you have solved the 1st problem ;all your fields are under one legends so use separate legends for each field .
Hi Priyesh, the way your view is constructed (with each CR time set up as a separate calculated field for each location vs locations as columns ), you are going to have a brutal time color coding each of these measures separately.
To do so, you're going to have to set up a dummy column for each measure, and create a calculated field for each column to do the color coding.
Here's one approach -- I've only included CR1 Time in ths view:
You can see how the dummy columns are created -- min(0) -- with measures inserted as text in the marks card.
To do the color coding, i did a series of 3 calculated fields here, but they can be combined into one or two:
CR1 Time Total: TOTAL([Cr1 Time])
CR1 Time Total 20%: TOTAL([Cr1 Time]) * .2
Cr1 Time > 20% of Total: [Cr1 Time] > [Cr1 Time Total 20%]
This last field is used on the color shelf.
I've attached a workbook (v10.5).
FYI not sure if this is me (i.e. my laptop), but i'm finding your workbook to be brutally slow to work with. For views involving many many calculated fields, I've found it a good practice to do everything i can to move calculated fields in Tableau back to my analytical file (i.e. create CR time and frequency values for each location during data prep).
Colour Coding (2).twbx 106.5 KB
Here's what i mean by a simpler view with location as columns and CR time as a single measure:
Now if you can come up with a single calculated field indicating that CR Time in a given cell is greater than total CR time for the corresponding column, you can color code the columns separately and in one step as per Norbert's post.
The color coding calculated field won't be simple, it will have to involve a LOD expression fixed on location. I'll give this a try later on time permitting.
...maybe not so difficult after all.
The color coding field for CR time as a single measure used in the attached workbook (v10.5) is:
Crstim > 20% of total: SUM([Crstim]) > (TOTAL(SUM([Crstim])) * .2)
Drop this on the color shelf, and then click on the pill arrow to select Edit Table Calculation.
To color code each column separately, apply the calculation by specific dimensions (location and reason), restarting every location.
I don't know if this view meets your requirements, but it is significantly easier to set up compared the approach i show above.
Colour Coding_3.twbx 130.8 KB
Thanks You Glenn
This is what exactly I am looking.Nice Approach....
Thanks all for your help.