Friday, 4 December 2015

Filtering Top N% or Bottom N% of the Whole Report

We can get it either Top 95% of total, ot Bottom 95% of total by using Sort option.

Top Cities upto 95% of total Sales1.png


Bottom Cities upto 95% or Less2.png


I used t he Following calculations for this task,

Running Sum (Field)
Syntax: RUNNING_SUM(sum([Sales] ))

Window Sum (Field)
window_sum(sum([Sales] ))


Upto .95  (Field)
Syntax:
if (RUNNING_SUM(sum([Sales] ))/ window_sum(sum([Sales] )))<=.95 then (RUNNING_SUM(sum([Sales] ))/ window_sum(sum([Sales] ))) end



you want to show list of cities upto 95 % of total, & hide remaining things, then create a calculated field (Boolean) then drop it into Filters then select "Yes". like the below screen shot.

Name: Show Cities upto 95 % of  Running total
Syntax: (RUNNING_SUM(sum([Sales] ))/ window_sum(sum([Sales] )))<=.95

11.png

22.png

33.png

How to apply ranks on Dates

1) Drag the [Order Date] field onto work Area. --- Field 1 on work area
2) Right click on that date field, then click on "More". then click on "Custom" then select Date format "Month/Date/Year".
3) right click on [Order Date] on work area, then click on "Measure" option, then click on "Maximum".  --- Field 1 on work area
4) Repeat first 2 steps.  --- Field 2 on work area
5)  Right click - Field 1 on work area then click on "Edit in shelf".

6) Redefine the calculation as like below
rank(max([Ship Date]))

7) Now Report with Dates, Ranks based up on Dates.
8) Create a Parameter to control the data on the report.

Parameter Name: Less than Equal
Data Type: Integer
Option: All
9) Drag the Field 1 on work area into Measure & define the name of field as "Ranks of Dates".
10) Right click on "Ranks of Dates" then click on "Create calculated field then develop the query as like below.
Name: Upto Selected Ranks
Syntax: [Ranks of Dates]<=[Parameter 1]

11) Drag the above calculated field into filters shelf, then right click on "Parameter" then click on "Show Parameter Control".
12) Now you can select the Number of Max Dates.

Thursday, 3 December 2015

Sorting the Data as per Last Month Sales Volums



1) Create a calculated field like below to get the Last month Sales Volume

if
year([Order Date]) = year(today())
and
month([Order Date]) = month(today())
then
sum(sales])
end

2) Then drag all required fields onto work area, then right click on Dimension which you want to custom sort, click on "Sort" then select field, then pick above calculated field.

Dynamically Selecting the Measures & Dimensions

Dynamically Selecting Measure & Dimension values in the View.

Parameter: Parameters are variable, which are used to pass the values dynamically to the view.

An example of using Parameter is "Dynamically Selecting Measure & Dimension values in the View.


1) Create a Parameter for Dimension Selection purpose "Dimension Parameter", By using this Parameter, we can select the Dimension Value (Field) dynamically.
9.png
2) Create a Parameter for Measure Selection purpose "Measure Parameter", By using this Parameter, we can select theMeasure Value (Field) dynamically.
10.png
3) Create a Calculated Field for Dimension Selection  using the syntax in the image.
1`4.png
4) Create another calculated field for Measure Selection like below image.
15.png
3) Place "Measure Selection", "Dimension Selection"  calculated fields, Right click on both Parameters & Click on "Show Parameter Control". (Note: We can  select Max 1 Value at a time from any parameter, It means Parameter limitation is Select Max 1 Value at a time.)
11.png
12.png


13.png

==============================
The following example explains when measures located on two databases.

Create a Parameter5.png
By using Parameter, create 2 Calculation for QS1, QS26.png
7.png
Then Place two measures on the Report like below image.Then you can define different marks for both measures.
121.png
When we select "QS1" from parameter,
122.png
When select "QS2",
1123.png
When Select "Both",
121.png

Importing Images

We can add our customized Images to report.


1) Create a new Folder in the Shapes Folder, then add your shapes.
82.png83.png
2) then Reload the Shapes in the view.
84.png
Then Select the New folder which was created in previous steps.
85.png
3) Then you can assign the Shapes accordingly.
86.png
88.png
4) Now we can show New Shapes on the Report.
90.png

Sorting in Tableau

Sorting



We can define the Sorting in different Ways.




1) Based upon Single Column (Such as Sorting on Region. Sorting on City). Note Only single at a time.
1.png

2) If you want to Sorting Cities of West in Desc, Cities of Central in Ascending, then we need to select the Region one by one individually on the Work area then Apply the Sorting.


12.png

13.png

114.png


3) The below screen shot is intend to sorting the Report according to "Region' Sales Value".
Before Sorting.png


Defining the Sorting of Region as Sales Volume figures
Sorting Regions - Sales Figure Base 1.png


After Sorting
After Sorting.png


Regions are in Ascending, Cities are in Descending order as Sales Figures
Regions - Asc    City - Desc.png



If we want to Apply sorting using two Fields, We need to combine the Fields like the Below screen shotCombine.png


After combining 2 Fields, we get the New field like below screen shot.
11.png



In the following screen shot, I used the Combined Fields for sorting purpose.111.png





===========================

http://viztableau.blogspot.in/2015/12/how-to-convert-string-to-date.html

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