Types of Sorts

Sorts
Sorts are of different types,
1.     Simple Sort
2.     Complex sorts
3.     Advanced Sort using Calculated field

1.     Simple Sort
·       Pull Region onto Columns, Sub-Category onto Rows and Sales on the Text on Marks card. Database used is Sample Superstore and Tableau 10.3.
·       We can find the highest ‘Sales’ in each ‘Region’ by clicking on the ‘Sort’ Button beside each Region. Here the Sub-category ‘Phones’ has the ‘highest Sales’ in ‘East Region’.
·       Note: The default sort type is Descending.

·       We can sort the Sub-Category too, it will be ascending and Descending according to alphabetical order.

·       We can also sort the Sales ‘Row-Wise’, this give the sales from high to low Sales for that particular Sub-Category.
·       Now Pull Category onto Rows, Click on the Category, goto Sort, we can see the window as shown in the below pic. We have options for Sort Order Ascending, Descending.
·       Sort By : Data Source Order, Alphabetic, field, Manual.
·       Data Source Order: If we have multiple data sources in the dashboard, we have the option to sort it based on the Data Source.
·       Alphabetic: Its based on simple Alphabetic Sort Order A-Z.
·       Field: We can select the sort order based on any field in the data source like Sales or Profit along with the aggregation Sum, Avg etc.
·       Manual: We can manually move the values Up or Down until we get the order of values we want to show.

2.     Complex Sort:
·       Pull Year(Order Date) , Sales onto Columns, Sub-Category onto Rows, Region onto Color on Marks Card. This view shows the sales of each Sub-Category, in each year in each Region.
·       We can Sort the Sales by Year(Column-wise) or Sub-Category(Row-wise) as shown in pic below.
·       Note: How can we Sort the Sales Region-wise here.
·       The developer can simply do it by Swapping the Region (in Colors on Marks) and Order Date(in Columns). To do this Hold the Control key and click on both Region and Order Date, Right Click and choose swap.
·       Now the Region will be in Columns and Order Date in Color of Marks . We can Sort the data on Region now.

3.     Advanced Sort using calculated field:
·       How to sort entire data using Region ‘Central.
·       Create a Calculated Field, Name it Central and give the formula as below.
·       If [Region] = ‘Central’
·       THEN [Sales]
·       ELSE NULL
·       END
·       Click on Sub-Category, Select Sort, In the window Select the Sort by as Field, Select the calculated field we created Central. The data will be sorted based on Central region now but it will not be clearly visible. Observe that the Sum(Sales) of Central region all years combined for Chairs is higher than the rest.




Comments

Popular posts from this blog

HOW TO USE RANKS IN REAL TIME SCENARIOS IN TABLEAU