3 Replies Latest reply on Feb 27, 2018 4:49 PM by Ivan Young

    Best Method for linking specified table dimensions to a certain measure using IF, IIF or CASE for Tableau 9.0?

    Ian Besmond

      I have two tables that I am trying to link together to give me the measure from one of the tables.

       

      I had tried to write an IF statement, but it doesn't return the correct measure.

       

      Table one is composed of various price lists that are location specific.

       

      My formula was IF [the price list code] = [the location that is associated with that code] THEN [price from that price list] and continue for each code

      ELSE [default price] END (The default price being price that doesn't apply to a specific location)

       

      EG. IF [Price List]='USPL' AND [Location]='USA' THEN [Price] ELSEIF [Price List]='CAPL' AND [Location]='CAN' THEN [Price] ELSE [Price] END

       

      In my view I want to be able to look at all locations and see the different prices at each location.

       

      However when I have Location in the view and the calculated measure in the view with the average price, it repeats the average price across all the locations.

      If I replace the Price List with the Location, I get the correct result, but I want the location to act as the price list code.