3 Replies Latest reply on Jan 24, 2019 7:04 AM by Paul Wachtler

    Filter by Year and Show Previous Year

    Yul Beauchamps

      Hi Folks,

       

      This should be relatively simple but I'm not sure why this is stumping me.  So I started out by just having a simple filter on a Date filed so a user could select a Year to filter on.  Then I decided I wanted to get a little fancy and show the previous year's data for side by side comparison.  I couldn't quite figure out a way to maintain a plain 'Year' filter but include the previous year's data as well.  Basically, if someone were to pick 2018 they could see 2017 & 2018.  After searching around I found several articles that made use of a Parameter instead and linked it to a calculated field which could then be used as a filter.  So I created a Date Parameter based on a range of values in 1 year step sizes with a custom display format of 'yyyy'.  Then I created a "Year Filter" calculation based on my date field and moved it to the filter shelf.  I thought I could create a custom formula to make the filter equal to the parameter selection.  I suspect the problem is with mismatched data types but I can seem to resolve the issue.

       

      I don't know there might be a completely better way so I'm open to suggestions but I have added a sample workbook with the Parameter and 'Year Filter' calculation created.  It's not currently sitting on the shelf since I couldn't' make the formula work.

       

      Thanks,