your cart

How to drill down on map

      Following last post, in this post we will see how to drill down from customer to customer order. If you have 3 level to drill down, just need add another level filter, the logic is same.
      We still use same data as below:
OrderIDOrder DateCustomerIDCustomer NamePriceAddressLatitudeLongitude
D0016/23/2019C001Mike221050 Rue Drummond #102, Montréal, QC H3B 0G345.500491-73.578092
D0156/25/2019C001Mike311050 Rue Drummond #102, Montréal, QC H3B 0G345.500491-73.578092
D0056/24/2019C002Jerry291050 Rue Drummond #606, Montréal, QC H3B 0G345.500491-73.578092
D0066/27/2019C002Jerry481050 Rue Drummond #606, Montréal, QC H3B 0G345.500491-73.578092
D0166/23/2019C003Anna521050 Rue Drummond #269, Montréal, QC H3B 0G345.500491-73.578092
D0026/24/2019C003Anna511050 Rue Drummond #269, Montréal, QC H3B 0G345.500491-73.578092
D0036/25/2019C003Anna551050 Rue Drummond #269, Montréal, QC H3B 0G345.500491-73.578092
D0076/26/2019C003Anna591050 Rue Drummond #269, Montréal, QC H3B 0G345.500491-73.578092
D0086/27/2019C003Anna511050 Rue Drummond #269, Montréal, QC H3B 0G345.500491-73.578092
D0096/28/2019C003Anna601050 Rue Drummond #269, Montréal, QC H3B 0G345.500491-73.578092
D0106/29/2019C003Anna691050 Rue Drummond #269, Montréal, QC H3B 0G345.500491-73.578092
D0046/27/2019C004Larry901050 Rue Drummond #369, Montréal, QC H3B 0G345.500491-73.578092
D0116/24/2019C005William161050 Rue Drummond #1102, Montréal, QC H3B 0G345.500491-73.578092
D0126/25/2019C005William221050 Rue Drummond #1102, Montréal, QC H3B 0G345.500491-73.578092
D0136/27/2019C005William191050 Rue Drummond #1102, Montréal, QC H3B 0G345.500491-73.578092
D0146/29/2019C005William301050 Rue Drummond #1102, Montréal, QC H3B 0G345.500491-73.578092
      This time we use a random to jet the dot because only one customer order will show on map, so no need make them a line.
      First we create a set using 'Customer Name'

      Then we need create some new calculated field:
      Detail: it use LOD to make sure that each row get same value when dots is selected. First row tells tableau if no customer is choosed, then return null. Second row tells tableau if it's nul, return Customer ID. Third row tells if any Customer Name is choosed, then return Order ID of this customer.
      IF ISNULL({MIN(IF [Customer Set] THEN [Customer Name] END)})
      THEN [Customer ID]
      ELSEIF [Customer Set] THEN [Order ID]
      END
      Detail Label: same logic as above formula, the differnce is return a string instead of field.
      IF ISNULL({MIN(IF [Customer Set] THEN [Customer Name] END)})
      THEN 'Customer ID'
      ELSEIF [Customer Set] THEN 'Order ID'
      END
      Price Label: same logic as Detail Label.
      IF ISNULL({MIN(IF [Customer Set] THEN [Customer Name] END)})
      THEN 'Avg Price'
      ELSEIF [Customer Set] THEN 'Price'
      END
      Show: same logic in first 2 rows. Third row tells tableau if some customer is selected, we give him a tag 'Show'. Fouth row tells tableau if customers are not selected, then give them a tag 'Hide'.
      IF ISNULL({MIN(IF [Customer Set] THEN [Customer Name] END)})
      THEN 'Show'
      ELSEIF [Customer Set] THEN 'Show'
      ELSE 'Hide'
      END
      Then Drag Detail, Detail Label and Customer Name to Detail marks, Show to Filters, and only select 'Show'
      
      Then modify tooltips as below:

      When you hover on a dot, it will show you see this customer infomation, when you click on it, it goes to order level. When you select and then unselect a order, it will come back to customer level.

      



Blog Category