2 Replies Latest reply on Sep 11, 2019 5:17 AM by Gaytri k

    Lookup for Previous String value

    Gaytri k

      Hi team,


      I have a Fiscal Year column in my Data called as FYFY which has values like below and they are strings. For various reasons, i cant change its data type to any other Data type in tableau.

      What im trying to achieve is, i want to make my charts work dynamically when year changes.


      For finding current year Orders, i have the below calculated field which works just fine:


      IF [FYFY] = {fixed : max([FYFY])} THEN [Order ID] END



      For finding previous year Orders, i need to alter the above to lookup for the previous value of max([FYFY]).


      I'm trying with the below formula but it gives error : LOD cannot contain table calculation.


      IF [FYFY] = {fixed : Lookup(max([FYFY]),1)} THEN [Contact Type] END


      Any workaround for this ? please