10 Replies Latest reply on Apr 4, 2018 1:25 PM by Prabhat Gautam

    Mixing Strings and Float Character Types in IF Statement

    Lauren MacMillan

      Hi All,

       

      I have a table that shows the Population  for US Counties, by Race/Ethnicity and Nativity, but would like to limit this to only show if the county has greater than 10000, for each particular segment. Ideally, I would be able to replace the percentage with "N/A", but the formula below doesn't seem to work.

       

      IIF(TOTAL(SUM([2011Population]))>10000, SUM([2011Population]) / TOTAL(SUM([2011Population])), "N/A")

       

      I get an error: "IIF is being called with (boolean, float, string), did you mean (boolean, float, float)?" I tried replacing "N/A" with 9999 and that worked fine, so I'm pretty sure its a data type/ syntax issue.

       

      Here is a picture of the table I'm trying to alter. This is filtered by county, and in this case all would show N/A except for Non-Hispanic White.

      Nativity_County Filter Example.PNG

       

      Any help would be greatly appreciated.

       

      Thanks,

      Lauren