2 Replies Latest reply on Sep 21, 2018 10:06 PM by Patti P

    Isolating values with conditions

    Patti P

      hello everyone,


      I think this should be easy, but for some reason I can't seem to find a lead on a possible solution.  I realize it is best when tableau files are attached but I can't share my actual data.


      I have the following data (below is a dummy sample) and I need to be able to 'bucket' at the item level those items with transactions by transaction type for each year (to do a YoY) comparison later



      will really appreciate any guidance

        • 1. Re: Isolating values with conditions
          Ankit Bansal



          What is the issue you are facing here?


          you can simply keep transaction type and year(transaction date) on column shelf and quantity on row shelf and you should be good with that.

          if you want item also then keep that also in column shelf.


          Ankit Bansal

          • 2. Re: Isolating values with conditions
            Patti P

            I need to be able to isolate each item by transaction type within each year, the reason I need to do a calculated field is because I need to calculate yoy metrics for each.  The yoy function doesn't work as it always leaves a blank year and it can't be hidden when trying to show sum of total and yoy change.


            I was doing something like this:


            If [transaction type] = "collections" then [qty] end for the transaction type


            if IF YEAR([Transaction Date])= 2017 THEN [Qty] ELSE 0 END for the transaction year


            the problem I face with this is that not every item has a collection qty, so when I do the yoy calculation it gives me blank results