Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Columns and Tables not showing up when using IF function

When I use the IF function, no tables or columns are coming up. I've seen through reading forums that trying an aggregate function such as SUM and AVERAGE will solve this, but am unsure how to use those functions and still complete the calculation that I am trying to solve with using the IF function.

 

When I do use the aggregate functions such as SUM and AVERAGE, the columns and tables do appear.

 

I am on tight deadline to finish this, so if someone could assist it would be much appreciated.

 

Thanks!

  • Anonymous's avatar
    Anonymous
    5 years ago

    Anonymous 

    There is a difference for between column and measure with IF(). For example, 

    Column = IF([Product]=1,True(), False())
    Measure = IF(sum([Product])=1, True(), False())


    Both return the same results but for measure you would need to add an aggregation expression in front(Sum, Min, Max). Normally this does not mean anything just let you refer to a column value.


    Paul Zheng _ Community Support Team
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies

  • Anonymous , your need is not clear. You need to use a measure or aggregated column inside measure

    • Anonymous's avatar
      Anonymous
      Not applicable

      The first screenshot is how i am hoping the IF function would perform... however it is showing the bottom image instead which gives me no option to utilize the different tables and columns. Does this help?  amitchandak 

       

       

       

      • camargos88's avatar
        camargos88
        Community Champion

        Hi Anonymous ,

         

        You need to aggregate the values using aggregate functions like SUM, MAX, MIN...

         

        IF inside the measures expects scalar values.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous 

    There is a difference for between column and measure with IF(). For example, 

    Column = IF([Product]=1,True(), False())
    Measure = IF(sum([Product])=1, True(), False())


    Both return the same results but for measure you would need to add an aggregation expression in front(Sum, Min, Max). Normally this does not mean anything just let you refer to a column value.


    Paul Zheng _ Community Support Team
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.