1 Reply Latest reply: Nov 5, 2012 10:45 AM by tmendesf RSS

    IF expression with multiple conditions

      Hello everyone,

       

      I need to write a "IF expression" with 4 conditions and I am having troubles.

       

      I have 2 dates: DataMovimento and DataCalendario and thus two calendars.

      I would like that: if the user selects a Year/Month/Week/Day of one calendar then the date of the other calendar becomes the same.

      The field I need to aggregate is OreDisp (number of hours available)

       

      My try:

       

      if( GetSelectedCount(Date(DataMovimento)) ,  sum( { <DayCalendario = {"=Day(DataMovimento) "}>} OreDisp) ,

                      if(GetSelectedCount(Settimana), sum(   {$<SettimanaCalend = {"=Settimana"} >}   OreDisp) ,

                if(GetSelectedCount(Month), sum(   {$<MonthCalendario = {"=Month"}>}   OreDisp) ,

                if(GetSelectedCount(Year), sum(   {$<YearCalendario = {"=Year"}>}   OreDisp) ,0)

      )))

       

      It does not seem to work!

      Thank you for any reply.

        • Re: IF expression with multiple conditions

          Olá

           

          Não sei se entendi bem o teu problema mas tenta assim (não testei!).

           

          if( GetSelectedCount(Date(DataMovimento)) ,  sum( { <DayCalendario = {"Day(DataMovimento) "}>} OreDisp) ,

                          if(GetSelectedCount(Settimana), sum(   {$<SettimanaCalend = {'Settimana'} >}   OreDisp) ,

                              if(GetSelectedCount(Month), sum(   {$<MonthCalendario = {"Month(DataMovimento)"}>}   OreDisp) ,

                                   if(GetSelectedCount(Year), sum(   {$<YearCalendario = {"Year(DataMovimento)"}>}   OreDisp) ,0)

          )))

           

          Entretanto, se não funcionar mete um sample file

           

          TMF