3 Replies Latest reply on Jun 21, 2018 11:03 PM by Zhouyi Zhang

# Min/Max indicators to Sparklines

Hi All,

I wanted to show the Max/Min Sparklines in the chart based on Market i.e only 1 max and 1 min values should be shown for each Market but in the viz it shows both the min and max values for each year and Market.

https://public.tableau.com/profile/sahil.sethi#!/

Thanks

• ###### 1. Re: Min/Max indicators to Sparklines

Hi,

The scenario has been explained very nicely by @Andy Kriebel.  Please refer below link for the video.

https://youtu.be/kAOcjSlKGB4

• ###### 2. Re: Min/Max indicators to Sparklines

Hi,

I've slightly modify your calculated field and included both Max and Min in a single calculation

Min or Max:

IF SUM({FIXED [Market]:MAX({fixed [Market],DATETRUNC('year',[Order Date]): SUM([Quantity])})})=SUM([Quantity])

then SUM([Quantity])

ELSEIF

SUM({FIXED [Market]:MIN({fixed [Market],DATETRUNC('year',[Order Date]): SUM([Quantity])})})=SUM([Quantity])

then SUM([Quantity])

END

Note: DATETRUNC('year',[Order Date]) your trend is showing yearly so I've used "year". If you've to show monthly trend then please use "month" datepart in the calculation else you'll get incorrect view.

Use this field on secondary axis and change the mark to circle.

Create a Boolean calculated field to color the min/max

Highlight:

SUM({FIXED [Market]:MAX({fixed [Market],DATETRUNC('year',[Order Date]): SUM([Quantity])})})=SUM([Quantity])

Drag this field on color shelf in your min/max mark

Note:

Hope this help.

Mahfooj

• ###### 3. Re: Min/Max indicators to Sparklines

Hi, Pallavi

Is it something like this you are after?

If yes, please find my solution attached.

Hope this helps

ZZ