19 Replies Latest reply: Feb 10, 2012 10:46 AM by present02 RSS

    how to use if statement in chart expression

      Hi all,

       

      I need to use IF statement in an expression  for a standard chart; I'm explaining with an example.

       

      I have a table like this:

      PK
      FK
      value
      1110
      2115
      329
      438
      5312

      User may select (or not) a set of data with different values for FK and cannot select FK values, but the chart has to create an expression like this:

      Show the trend of values having FK = 2.

      I may consider to implement a second line with a different FK value, and compare it with the first one.

       

      I already used an expression like this:

       

      If(value > genericVar, value, Null())

       

      it seems it works very well.

       

       

      If(FK = 2, value, Null())

      it seems it doesn't work very well - how to do?

       

       

       

      Count(If(FK = 2, value, Null()))

       

      it seems it works very well.

       

      Thank you