1 Reply Latest reply on Mar 15, 2017 12:20 PM by hetal joshi

    IF condition on Multiple Filters

    hetal joshi

      Hi, I have 2 filters .

       

      I am using those filters across multiple sheets in my workbook and also am using them in context and City filter is showing 'Only Relevant Values'.

       

      1st Filter is for State 2nd Filter is for City (Within that state)

       

      Now, I want to write an if condition/calculated field that will do the following:

       

      When Filter 1 = Texas then show the straight goal line as 12 when Filter 1 = Texas and Filter 2 = Austin then do not show the goal line at all when Filter 1 = Texas and Filter 2 = Houston then do not show the goal line at all.

       

      Basically, the point is not to show the goal line at all if any of the Cities is selected specifically from the Filter 2. (I am showing both Filter 1 and Filter 2 on the dashboard for users to select from) So far I have been trying to use this formula for achieving above conditions.

       

      IF

      ATTR([STATE]) = 'Texas' and ATTR([CITY]) = 'Austin' then FLOAT('')

      ELSEIF ATTR([STATE]) = 'Texas' and ATTR([CITY]) = 'Houston' THEN FLOAT('')

      ELSEIF ATTR([STATE]) = 'Texas' THEN 12

      END

      This is working in some instances but in others it is not and I am not sure why it is not working. For instances it is not working, it displays the goal line irrespective of the selection of Filter 2 (City).

      If I change the order to below it shows goal line 12 for all the selections of filter1 and filter2.

       

      IF

      ATTR([STATE]) = 'Texas' THEN 12

      ELSEIF ATTR([STATE]) = 'Texas' and ATTR([CITY]) = 'Austin' then FLOAT(')

      ELSEIF ATTR([STATE]) = 'Texas' and ATTR([CITY]) = 'Houston' THEN FLOAT(')

      END

       

       

      Any guidance will be much appreciated.

       

       

      Thanks,