Filtering in Tableau by combining multiple fields

0 votes

What I want?

Get all Customers from a certain city that made an order from the same city on a certain date range and made the order from the same city at any Date before this certain Date range.

What I did?

I tried was to Create 3 Parameters, one that holds the Certain Order_Date called "Certain_Date", one that Hold the End Date of a Date Range I want to see called "End_Date" and one that holds the Name of the city "Certain_City".

Here my Calculation field:

IF { FIXED [Customerid], [Certain_City] : MIN(Order_Date) < [Certain_Date] }
AND { FIXED [Customerid], [Certain_City] : MAX(Order_Date) >= [Certain_Date]}
THEN "Customer Ordered from City before"
ELSE "Customers first Order from this City"
END

This Calculated field, however, does not work, it only gets me the Customers that made an order from any City before.

Also, I used a Filter to show only the CustomerID-s that ordered from the Certain_Date to the End_Date. But it won't work, any Ideas?

Here An Example of what I want:

>     Order_Date Customer_ID City
>     01.10.2016 1234        Stockhom
>     01.05.2016 1234        Stockhom
>     01.03.2016 1234        Oslo
>     05.10.2016 1455        Berlin
>     01.04.2016 1455        Berlin
>     02.10.2016 1211        Stockhom
>     06.03.2016 1211        Prague

Let say the "Certain_Date" is 01.10.2016 and the "End_Date" is 03.10.2016

From this Data I want to create a Barchart that holds the Number of Unique CustomerID-s, and that colors the "Customer Ordered from City before" and the "Customers first Order from this City".

In this Example the Barchart would go up to 3 Elemnts. Where the CostumerID-s 1234 and 1455 would be colored Blue because they ordered from the same City before, and 1211 would be colored Red because it ordered before the Date but not from the same City.

Aug 30, 2018 in Tableau by Atul
• 10,240 points
905 views

1 answer to this question.

0 votes

Try This

Create 3 parameter

  1. Start Date

  2. End Date

  3. City

Now

Create a Calculated Field C1

 {fixed [Customer],[OrderCity]:max(if OrderDate>=StartDate and OrderDate<=EndDate then 1 end)}

Create Another Calculated Field C2

 If C1>=1 and orderDate<StartDate then 'true' else 'False' end

Put This C2 in Filter Set Default value=True

Tell me if it worked?

answered Aug 30, 2018 by Atul
• 10,240 points

Related Questions In Tableau

0 votes
1 answer

Filtering multiple combinations of two fields in single worksheet

Hi anitha, Follow below steps: 1. Split the order ...READ MORE

answered Apr 10, 2019 in Tableau by Cherukuri
• 33,030 points
741 views
0 votes
1 answer

Aggregating multiple column in Tableau

You can use Tableau’s inbuilt pivot method ...READ MORE

answered Jun 30, 2018 in Tableau by ffdfd
• 5,550 points
715 views
0 votes
1 answer

How to aggregate multiple column in Tableau?

You can use Tableau’s inbuilt pivot method ...READ MORE

answered Jul 10, 2018 in Tableau by ffdfd
• 5,550 points
2,718 views
+1 vote
1 answer

How to perform top N fields with nested sort in tableau

You can use the following steps: Sort 'State' ...READ MORE

answered Aug 4, 2018 in Tableau by ffdfd
• 5,550 points
4,309 views
0 votes
1 answer

How to create a filter based on date range?

You can use this code snippet in ...READ MORE

answered Aug 8, 2018 in Tableau by Nitish
• 630 points
1,012 views
0 votes
1 answer

How to display days data based on date selected in the filter by the user.

You can create a parameter for dates. Select data ...READ MORE

answered Aug 15, 2018 in Tableau by AwesomeSauce
• 860 points
1,653 views
0 votes
1 answer

Action filter (on set) is appearing in my worksheet.

Those are the action filters that we ...READ MORE

answered Aug 17, 2018 in Tableau by AwesomeSauce
• 860 points
2,447 views
+1 vote
2 answers

How to join tables based on “Calculated Fields” in Tableau?

You absolutely can join to a calculated ...READ MORE

answered May 30, 2019 in Tableau by anonymous
24,543 views
0 votes
1 answer

How to color code cells of a column based on the text value in Tableau

You can use the following steps to ...READ MORE

answered Mar 27, 2018 in Tableau by Atul
• 10,240 points
9,891 views
0 votes
1 answer

How can I count the aggregate function in Tableau

Create two calculated fields one for 100's ...READ MORE

answered Apr 6, 2018 in Tableau by Atul
• 10,240 points
5,648 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP