3 Replies Latest reply: Jun 21, 2017 3:25 AM by Rima Hajou RSS

    Set expression to multiply factor based on range

    Deepika TR

      Hello,

       

      Below are the table structures I have:

       

      Events:

      Load * Inline [

      Event, EventDate, EventAmount, EventOnTime, EventHappened

      1, 1/1/2017, $100, 1, 1

      2, 1/1/2017, $200, 0, 1

      3, 1/2/2017, $50, 0, 1

      4, 1/31/2017, $500, 1, 1

      ];

       

      Percent of events that happened on time for the Month of Jan 2017 would be (1+0+0+1)/4=50% (Let this number be called P)

       

      Factor:

      Load * Inline [

      FactorType, MinPercent, MaxPercent, Factor

      A, 0%, 25%, 100%

      A, 26%, 75%, 60%

      A, 76%, 100%, 0%

      ];

       

      In the visualization, I have created a line chart which shows the EventAmount by Month and for multiple Years. The chart looks something like like this.

       

      Capture.png

       

      The actual requirement is to multiply the EventAmount by Factor based on the range in which "P" belongs. In this case, for Jan 2017- EventAmount($850)*Factor(60%)=$510. $510 is the number which has to be represented in the line chart.

       

      How to write set expression for the above requirement?

       

      Thanks in advance.

      Deepika