2 Replies Latest reply on May 20, 2016 7:12 AM by Mike Anderson

    Filter by date based on date range selection in different worksheet

    joerg.reichelt

      Hi,

       

      I have worksheet A with two date/time columns "StartDate" and "EndDate".

      I have worksheet B with one date/time column "TimeStamp"

       

      After selecting one row on worksheet A I want to show all rows of worksheet B where TimeStamp is within StartDate and EndDate.

       

      I tried an Action Filter but this does not allow me to enter expressions like StartDate < TimeStamp AND EndDate > TimeStamp. I also tried to use a Parameter-based filer on Worksheet B but the Action Filter cannot be applied to parameters or calculated fields.

       

      Does anyone have an idea how to implement this?

       

      Thanks,

      J

       

      Edit: sample worksheet attached

        • 1. Re: Filter by date based on date range selection in different worksheet
          G Marc Turner

          I'm thinking this might be possible by creating a calculated field based on the values in Worksheet A that returns either True/False or similar. Then use that calculated field as a filter on Worksheet B. The trick will be getting the calculation to to work correctly, but without more information (e.g. where do the StartDate and EndDate values come from?) I'm not sure what would be needed. I'm thinking that it might need to be based on level of detail expressions. If you could attach a packaged workbook with some sample data it would be helpful in determining how this might be done.

          -Marc

          • 2. Re: Filter by date based on date range selection in different worksheet
            Mike Anderson

            I have the same question. I think this could be done with a URL filter, but other than that I don't know. This seems like a pretty basic use case, but I don't see any clean way for Tableau to handle it. I don't like the URL idea because I don't want to launch a separate dashboard, I want to see the two worksheets in the same dashboard. Two worksheets from different data sources (databases) where one data source provides a date range and the other data source has a specific date that you want to include if it's within the date range. Seems like dynamic parameters would allow this. Hope we see those soon.