6 Replies Latest reply: Nov 5, 2009 12:39 PM by Petra Bernehed RSS

    Set Analysis using several fields

    Petra Bernehed

      Hello Community,

      I am trying to use set analysis over several fields, but am having a problem with the syntax. Maybe someone can help?

      Here is my problem: This set

       

      =

      num(SUM( {$ <CW ={'$(vMaxCW)'}, SalesQuarter= , Salesmonth=, SalesWeek= >} UnitSalesIncl), '#.##0 kr')





      fixes the Calendar Week CW to the value of vMaxCW, no matter what other calendar entries are chosen. Works great. Then I also have another set which sums over the same time period as above, but only for a selected contract id SelContractID. Here I am using an if statement for the date control which is not good as whenever you select another date, this invalidates ... so here is the original:

       

       

      =

      num(sum({$< ContractID = SelContractID >} if (InWeek(SalesWeek, MaxSalesWeek,0), UnitSalesIncl, 0)),'#.##0 kr')





      As you can imagine, I want to combine the 2 sets and get rid of the IF. I cannot seem to get the syntax to work though.

      Can someone help me please?

      Thanks and best regards,

      Petra