10 Replies Latest reply: Oct 25, 2017 11:33 AM by Aehman K RSS

    Is possible to use if statement into variable calculation?

    Maria Gonzalez

      Hi,

       

      I am trying to use if condition into variable calculation. I need to identify if day of the week is Monday to go back 2 days until Saturday.

      the expresions works well, I valideted both,  however the if condition is not working well.

       

      if( num(weekday(Date)) = 1,

      Count(

           {$

                <Date={"$(=Date(max(Date),'DD/MM/YYYY'))"}, _Id_Flag={0},Estatus_Cobranza= {'EN SURTIDO','FACTURADO','ENTREGADO','CONSOLIDADO'}, Liberado={1}, TipoDeEntrega -= {'SOLO FACTURA'},Year={$(vAñoActual)},Month=,Week=>

                +

                <Date={"$(=Date(max(Date)-2,'DD/MM/YYYY'))"}, _Id_Flag={0},Estatus_Cobranza= {'EN SURTIDO','FACTURADO','ENTREGADO','CONSOLIDADO'}, Liberado={0}, TipoDeEntrega -= {'SOLO FACTURA'},Year={$(vAñoActual)},Month=,Week=>

           }

           distinct Numero_OrdenVenta),

          

      Count(

           {$

                <Date={"$(=Date(max(Date),'DD/MM/YYYY'))"}, _Id_Flag={0},Estatus_Cobranza= {'EN SURTIDO','FACTURADO','ENTREGADO','CONSOLIDADO'}, Liberado={1}, TipoDeEntrega -= {'SOLO FACTURA'},Year={$(vAñoActual)},Month=,Week=>

                +

                <Date={"$(=Date(max(Date)-1,'DD/MM/YYYY'))"}, _Id_Flag={0},Estatus_Cobranza= {'EN SURTIDO','FACTURADO','ENTREGADO','CONSOLIDADO'}, Liberado={0}, TipoDeEntrega -= {'SOLO FACTURA'},Year={$(vAñoActual)},Month=,Week=>

           }

           distinct Numero_OrdenVenta))

          

      Somebody can help me?

       

      thank you!