-
1. Re: Custom Shape/Color Issue when showing multiple measures
Joe Proulx Jul 19, 2016 10:35 AM (in response to Joe Proulx)Still hoping to find a solution. Management liked the idea and the viz, I just need to figure out how to mute those shapes/colors correctly.
-
2. Re: Custom Shape/Color Issue when showing multiple measures
swaroop.gantela Jul 20, 2016 6:44 AM (in response to Joe Proulx)Joe,
If your datasource is Excel or a text file, you should be able to take advantage of the pivot function
on the DataSource tab to realign your data into:
"CellNumber","Charge Type" ,"Charges"
123,SMS Overage,100
123,Long Distance,500
345,Other Charges,300
...
Here is a link on the steps:
Quick Start: Pivot Data (from Columns to Rows)
Then your Outlier Conditional would look like:
IF ([ChargeType]="Data Overage" AND [Charges]>100)
OR ([ChargeType]="Long Distance" AND [Charges]>500)
OR ([ChargeType]="Other Charges" AND [Charges]>500)
OR ([ChargeType]="SMS Overage" AND [Charges]>200)
THEN "Red"
ELSEIF ([ChargeType]="Long Distance" AND [Charges]>100)
OR ([ChargeType]="Other Charges" AND [Charges]>100)
OR ([ChargeType]="SMS Overage" AND [Charges]>100)
THEN "Light Red"
ELSE "GRAY"
END
If your datasource is not supported for pivoting, would you be able to reshape
your data externally?
-
211107cell.twbx 62.8 KB
-
-
3. Re: Custom Shape/Color Issue when showing multiple measures
Joe Proulx Jul 28, 2016 6:03 AM (in response to swaroop.gantela)I think you are exactly right swaroop.gantela and that this would solve my problem. However, the data source is a SQL database and because we're a large company, I doubt I'd get much traction asking for additional data shaping just to feed a single chart. Hmm.
I wonder if I can replicate the pivot with calculated fields...need to wrap my head around this...because I think you're correct.
-
4. Re: Custom Shape/Color Issue when showing multiple measures
swaroop.gantela Jul 28, 2016 6:37 AM (in response to Joe Proulx)Joe,
Will explore other options.Here are some threads discussing pivot and SQL:
Field Pivot - Microsoft SQL Server
-
5. Re: Custom Shape/Color Issue when showing multiple measures
swaroop.gantela Jul 29, 2016 4:13 PM (in response to Joe Proulx)Joe,
I think there might be a solution to be found with Data Scaffolding.
TDT: Data Scaffolding on Vimeo
http://vizdiff.blogspot.com/2015/11/data-scaffolding-in-tableau.html
It uses your original datasource laid out as is, and then requires
an additional worksheet which is the scaffold, which looks like the pivoted version:
Cell Number ChargeType
123 Adjustment
123 DataOverage
123 LongDistance
123 SMSOverage
123 OtherCharges
456 Adjustments
etc.
That scaffold is brought into the view with [ChargeType] on Rows.
Then this calculation is used to get the values from your source dataset:
[Values]:
CASE MIN([Charge Type])
WHEN "Adjustments" THEN SUM([SourceWorksheet)].[Adjustments])
WHEN "DataOverage" THEN SUM([SourceWorksheet].[Data Overage])
WHEN "LongDistance" THEN SUM([SourceWorksheet].[Long Distance])
WHEN "OtherCharges" THEN SUM([SourceWorksheet].[Other Charges])
WHEN "SMSOverage" THEN SUM([SourceWorksheet].[SMS Overage])
END
[Values] is placed on the Column shelf
and [Cell Number] is placed on the detail shelf.
The Outliers are similar to before:
IF (ATTR([Charge Type])="DataOverage" AND [Values]>100)
OR (ATTR([Charge Type])="LongDistance" AND [Values]>500)
OR (ATTR([Charge Type])="OtherCharges" AND [Values]>500)
OR (ATTR([Charge Type])="SMSOverage" AND [Values]>200)
THEN "Red"
ELSEIF (ATTR([Charge Type])="LongDistance" AND [Values]>100)
OR (ATTR([Charge Type])="OtherCharges" AND [Values]>100)
OR (ATTR([Charge Type])="SMSOverage" AND [Values]>100)
THEN "Light Red"
ELSE "Gray"
END
-
211107cell2.twbx 65.6 KB
-
211107cell.xlsx 8.5 KB
-
211107scaffold.xlsx 8.7 KB
-