Thursday 3 December 2015

Want to analyze the data like Sales Variance Percentages from previous year to current Year.

1) Create a Calculated field to get the "2014 Sales" as the following screen shot.

t4.PNG
2) Create a Calculated field to get the "2015 Sales" as the following screen shot.
t5.PNG

3) Create a Calculated field to get the "2014  - 2015 Sales Variance" as the following screen shot.
t6.PNG

4) Right click on "2014  - 2015 Sales Variance" ,  then click on "Default Properties", then click on "Number Format".
t8.PNG
6) Then select "Percentage" as the Data format.
t9.PNG

7) now add all the Calculated fields.
t7.PNG


Wednesday 2 December 2015

Calculating Ranks in Tableau

Create a parameter like below.
43.png
create a calculation, drop it on "Text Labels"
56.png

Right click on parameter, then click on "Show Parameter Control".

Drag "Measure Selection" field twice onto Columns shelf, State on to rows shelf.
47.png
Then Right click on first Measure Selection Column (Rank) then click on "Discrete", Change ir from Column shelf to Row shelf.
48.png


Then applying the Sorting
49.png

Then Copy the Rank Column into "Filter Shelf". ( I am using laptop so how i am doing here is CTRL+ALT+Right click on Mouse + dragging into Filters shelf.)50.png

Then Apply the Filter on Ranking51.png

If you want to hide the Ranks, right click on rank field, click on "Show Header".
52.png

=====

I have added normal report, top 5 City report to the Dashboard to come to know how our calculation will work.
Measure

53.png

54.png



55.png

Tuesday 1 December 2015

How to Filter the Multiple Values.


As of now Tableau does not have "IN" operator to use in the Calculation but there is an alternative that is "OR"

Case [Region]
when "Central" then "Territory - 1"
when "East" then "Territory - 1"
else "Territory - 2" end

Or

If  [Region] = "Central" or   [Region] ="East" then "Territory - 1"
else "Territory - 2" end