8 Replies Latest reply: Nov 11, 2016 10:11 AM by Clever Anjos RSS

    Duvida set analysis

    jamir fonseca junior

      Bom dia pessoal!

       

      Meu primeiro post, desculpe se coloquei no lugar errado!

       

      Como fazer um set analysis para substituir este trecho:

       

      IF(Ano = 2011,

          Sum(IF(DataEfetiva <= MakeDate(2011,12,31) AND DataFinal >= MakeDate(2011,12,31),1)),

          IF(Ano = 2012,

              Sum(IF(DataEfetiva <= MakeDate(2012,12,31) AND DataFinal >= MakeDate(2012,12,31),1)),

              IF(Ano = 2013,

                  Sum(IF(DataEfetiva <= MakeDate(2013,12,31) AND DataFinal >= MakeDate(2013,12,31),1)),

                  IF(Ano = 2014,

                      Sum(IF(DataEfetiva <= MakeDate(2014,12,31) AND DataFinal >= MakeDate(2014,12,31),1)),

                      IF(Ano = 2015,

                          Sum(IF(DataEfetiva <= MakeDate(2015,12,31) AND DataFinal >= MakeDate(2015,12,31),1)),

                          IF(Ano = 2016,

                              Sum(IF(DataEfetiva <= MakeDate(2016,12,31) AND DataFinal >= MakeDate(2016,12,31),1))

      )

      )))))

       

       

      Muito obrigado!