Sunday 1 November 2015

Filters - Tableau



Generally we use the filters to reduce the number of records present on the report or to show only required data on the report & to improve the performance.
Tableau have the following different kind of filters
                                                                   I.            Regular Filters
•        Regular Filters – Dimensions
•        Regular Filters – Measures
•        Regular Filters – Date
                                                                II.            Quick Filters
                                                               III.            Context Filters


Regular Filters - Dimensions:
• All fields that are filtered show on the Filters shelf.
• We can apply the Regular filters either by dragging fields onto Filers shelf or in the view right click then select either hide or exclude.
• Right click on Field from the row shelf.

Here we can filter the data in 4 different ways

·         General
·         Wildcard
·         Condition
·         Top
a. General: select the required data which should only be showed on the report.

·         Drag the [Region], [Sales] fields into work Area.
·         Drag the [Region] into Filters shelf, then select “General” tab then select the region whichever you want to show in the report.
b. Wildcard: We can filter the data by applying Wildcard.

Contains:
EX 1 :
·         Drag the [Region], [Sales] fields into work Area.
·         Drag the [Region]into Filters shelf, then select “Wildcard” tab then select the “Contains”  then type ‘so’ then click on “OK” then report will filter the Region members and will show only “South” region data.
·         This option is used to filter the data by typing the our selection criteria, in the above line i have typed “So” tableau search & show in the Output which are having typed letter ‘so’ those records will only show in report.
EX 2:
Drag the [Region], [Sales] fields into work Area.
·         Drag the [Region]into Filters shelf, then select “Wildcard” tab then select the “Contains”  then type ‘st’ then click on “OK” then report will filter the Region members and will show only “East, West” regions data, because East , West only having the letters 'st".

o    EX 3: 
§  Drag the [Region]into Filters shelf, then select “Wildcard” tab then select the “Contains”  then type ‘SA’ then click on “OK” then report will filter the Region members and will show only 'NOTHING" it means empty report , because none of the Region Members having the letters "SA". (Both S, A should be one beside other it means "S" then "A").

Startswith:
·         Drag the [Region], [Sales] fields into work Area.
·         Drag the [Region]into Filters shelf, then select “Wildcard” tab then select the “Startswith”  then type ‘S’ then click on “OK” then report will filter the Region members and will show only “South” region data.
·         This option is used to filter the data by typing the our selection criteria, in the above line i have typed “So” tableau search which are having substring ‘S’ at starting position then those records will only show in report.
·         In this example we get the output “South” only but we don’t get “East” because “s” is not starting position in the East but in the “South” starting letter is “S”.
Endswith:
·         Drag the [Region], [Sales] fields into work Area.
·         Drag the [Region]into Filters shelf, then select “Wildcard” tab then select the “Endswith”  then type ‘st’ then click on “OK” then report will filter the Region members and will show only “East, West” regions data.
·         This option is used to filter the data by typing the our selection criteria, in the above line i have typed “st” tableau search which are having substring ‘st’ at ending position then those records will only show in report.
In this example we get the output “East, West” only but we don’t get “Central, South” because these 2 members are having ‘th’ from last.

c. Condition: We can filter the data by applying condition.
·         Drag the [Region], [Sales] fields into work Area.
·         And we use the Condition option to apply the multiple conditions Drag the [Region]into Filters shelf, then select “Condition” , select ‘by field’ option then select the measure field , Aggregate function, condition, then tableau will filter the data then will show the records which are satisfying the given condition.


 By Field: This option allow us to supply 1 condition at a time.
EX:sum([Sales])>10000 ------

By Formula: This option allow us to supply more than 1 condition at a time.
EX: sum([Sales])>10000 and sum([Profit])>1000

d. Top: We can filter the data by define top n records.
·         Drag the [Region], [Sales] fields into work Area.
·         Drag the [Region]into Filters shelf, then select “Top” , select ‘by field’ option then select the Top/Bottom Measure field , Aggregate function condition, then tableau will filter the data then will show the records which are satisfying the given condition.
·         EX: Top 3 Regions based up on sum([Sales])
Regular Filters - Measures: (Quantitative Filters)
·         We can apply filter on measure fields by applying aggregation filters.
·         In the following example, we are applying filter on Sales which should more than or equal to 5000.
·         Before apply the Filter, Tableau Engine automatically defines Min & Max values

Date Filters:

We use this kind of filters to filter the Date Data type kind of Data. By using this kind of filters we can show Required Years, or Months or Quarters Data, ( Jan-2015 or Yr-2015, Q1-2013.......)
Or We can show data for Specific range. (EX:  From 1-Jan-2011 to 12-Sep-2013,.........)

EX 1: List the customers who made Transactions in Year - 2011

1) Drag [Region], [Order Date], [Customer Name] fields into Rows shelf.
2) Drag the one of Measure fields from Measures window into Column Shelf.
3) Drag the [Order Date] into Filters shelf, then it will the list , here select Years , then check the box for Year -2011.


Tableau let's filter the Date Data in 2 Different ways.
1) Relative Date Filters.
2) Range Date Filters.

*********************
Relative Date Filters.
Relative date filters are dynamic, here values are changed accordingly.

EX: Relative - Current Year
Today Date #09-Jul-2014#
Description:
If you ask this Month Sales Data, It will show you Jul-2014 Data.
If you run the same report in Next month, it will show you Aug-2014 Data.
Means here we are filtering the Data like Current month, it will change as per the Day you run the Report. (Tableau is taking the Date from Operating System)

Tableau is offering the following different kind of Relative Date Filters.

Years, Quarter, Months, ........

EX: Today Date #09-Jul-2014#

Show me the Current Year Sales.
Today is #09-Jul-2014#, so it will show 2015 Data (including Future data also if database contains)

1) Drag [Region], [Order Date], [Customer Name] fields into Rows shelf.

2) Drag the one of Measure fields from Measures window into Column Shelf.

3) Drag the [Order Date] into Filters shelf, then it will the list that contains Relative & Range Filters, here select Relative then click on Years, Then Click on "This Year" radio button.

4) As of now this report shows 2014 Data.

5) If you run the same report after 1 year, it will show 2016 Data. ( DB should have 2016 data rather than it will show empty report).

EX: I want to show current Month, Quarter, Last Quarter this Year, Last month this Year, .........

I want to see last 3 Years of data on the Report.

*********************
Range Date Filters.

        This kind of filters allow us to define the Static range dates.
        And here we can't change date data, it means it is fixed Date filters.
        EX: Today we have created a report for year - 2012, if you run the same report in next year, it will show YR-2011 data only, now we can say these filter values are fixed. ( Dont consider Parameter, Quick Filters in this scenario.)
EX:
1) Drag [Region], [Order Date], [Customer Name] fields into Rows shelf.
2) Drag the one of Measure fields from Measures window into Column Shelf.
3) Drag the [Order Date] into Filters shelf, then it will the list that contains Range Filters, here select Range then Define Starting & Ending Dates.
4) As of now this report shows 2015 Data.
5) If you run the same report after 1 year, it will show 2016 Data. ( DB should have 2016 data rather than it will show empty report).

*********************
Tableau offers filtering the data in different ways also, we can call these are static filters.

1) Year wise, Month wise, Quarter wise, Week wise ,............
2) Starting Date to Till end of the Date as per data in the DB.
3) Up to certain Ending Date from starting Date.

*********************
Removing Nulls Data from the Report.
My data have nulls in Date Columns for Some Dates, i want to remove from the Report.

EX-1:
1) Drag [Region], [Order Date], [Customer Name] fields into Rows shelf.
2) Drag the one of Measure fields from Measures window into Column Shelf.
3) Drag the [Order Date] into Filters shelf, then it will show the list that contains Range Filters, here select Relative then click on "Special", then click on "Non-null dates" option.
4) Now Report don't have the null Dates.

Try out the following situations
1) I want to see data for Current month only.
2) I want to see Sales Information from 1-Jan-2015 to Today.
3) I want to see data for Year 2011 & 13 & 15
4) What is the Orders Amount for Current Quarter?
5) I want to see this year March Month Data. (Without using Range Filter, Use alternative approach)
6) I want to See Previous Year Data.


My data have nulls in Date Columns for Some Dates, I want to remove from the Report.
===================================================
Filters - Measures

We can filter the data on measures also by dragging the measure column & drop into filters shelf then click on "SUM" or any other Aggregate function then click o OK, then report will show filtered data.

And

We can filter the Measures range specific or filtering Nulls, or showing only nulls..........


Date Filters:
We use this kind of filters to filter the Date Data type kind of Data. By using this kind of filters we can show Required Years, or Months or Quarters Data, ( Jan-2015 or Yr-2015, Q1-2013.......)
Or We can show data for Specific range. (EX:  From 1-Jan-2011 to 12-Sep-2013,.........)

EX 1: List the customers who made Transactions in Year - 2011

1) Drag [Region], [Order Date], [Customer Name] fields into Rows shelf.
2) Drag the one of Measure fields from Measures window into Column Shelf.
3) Drag the [Order Date] into Filters shelf, then it will show the list Year, Quarter, Month......... , here select Years , then check the box for Year -2011.
 Hide original message

Tableau let's filter the Date Data in 2 Different ways.
1) Relative Date Filters.
2) Range Date Filters.

*********************

Filters - Measures

We can filter the data on measures also by dragging the measure column & drop into filters shelf then click on "SUM" or any other Aggregate function then click o OK, then report will show filtered data.

And 

We can filter the Measures range specific or filtering Nulls, or showing only nulls..........

****************
=============================================

Quick Filters:

        We use the Quick Filters to include or exclude the members from the report.

        It offers more interaction with report, It means End user can select required data instantly. If user don't want to see the data on the report, then they can deselect that specific member from Quick Filter.

EX:
1) Drag [Region], [Order Date], [Customer Name] fields into Rows shelf.

2) Drag the one of Measure fields from Measures window into Column Shelf.

3) Right click on  [Region] in the work area then click on Show "Quick Filter".


Changing the UI:

1) Single Value (List):  This option offers select only 1 member at a time or select all members by selecting "All" radio button.
It does not allow selecting multiple members from the selection criteria.

2) Single Value Drop Down List:
 This option also offers select only 1 member at a time or select all members by selecting "All" radio button.
It does not allow selecting multiple members from the selection criteria.

3) Single Value Slide Bar:
This option also offers select only 1 member at a time or select all members by selecting "All" radio button.
It does not allow selecting multiple members from the selection criteria.

4) Drop Down Multiple Values:
This option also offers select either at 1 or multiple members a time or select all members by selecting "All" check box.

5) Drop Down Multiple Values:
This option also offers select either at 1 or multiple members a time or select all members by selecting "All" check box.
Here List of the values shown in the drop down list.

6) Drop Down Multiple Values:
This option also offers select either at 1 or multiple members a time or select all members by selecting "All" check box.
Here List of the values shown in the drop down list.

7) Custom Value List:
This option also offers select either at 1 or multiple members a time or select all members by typing the characters.

It will search the members which are related to your typed word.
If type ST, it will show the data EAST, WEST then select which ever members want to show on the report.
It is quite similar to Contains filter.

*****************
Similarly we can apply the Quick filters for Measures.



No comments:

Post a Comment