Skip to main content

Here is my question.  In the superstore example, I have created a hierarchy that shows 9994 true customers. If you drill to the next level you will see ORDER_ID.  Because customers have placed more than one order see that FALSE appears on my unique customer filter.  So... How do I identify the first or last order of a customer who has multiple orders?  I will want to exclude them from a drill by limiting those multiple orders to the last shipping mode (or first).

 

Any ideas?  I was thinking something with max date or a LOD something... I have no idea. 

1 answer
  1. Feb 26, 2020, 9:04 PM

    This problem is easier when not using a hierarchy. If you always displayed Ship Mode, Customer Name, Order ID and Order Date for example, you could use a table calculation function like LAST() to find the last Order Date value within Ship Mode and Customer Name. Unfortunately when using a hierarchy, if Order ID or Order Date is removed from the view the table calculation filter becomes invalid, blanking out the viz.

     

    You can still do this using LOD expressions, though. You will want to use a FIXED LOD expression to identify for each Ship Mode and Customer Name what the maximum Order Date is (call it "Max Order Date"). Then you can filter your view on Order Date = Max Order Date, provided there aren't multiple orders with the same date for a given customer.

     

    Also, did you want your unique customers field to be COUNT(Customer Name) or COUNTD(Customer Name)? There are quite a few duplicate customer names in there...

0/9000