1 Reply Latest reply: May 14, 2011 2:34 PM by Erich Shiino RSS

    Set Anaysis Date Variable

      I have this variable to allow the user to modify


      I want to calculate with set analysis, sales from that date until today.


      Easy no???


      -sum({<"Posting Date" ={">=$(vFecha)"} Venta)


      Maybe it's because of the format


      Dosen't work


      Please help

        • Set Anaysis Date Variable
          Erich Shiino


          Did you try to use this expression instead:

          sum({<[Posting Date] ={">=$(vFecha)"} Venta)


          There maybe another issue:



          It's possible to make it work if you can guarantee that you can compare dates on the same format.


          I suggest the use of fields and variables as numbers (as they are actually stored both on QV and Excel).

          First, you need to create a field that you are sure will be only on a integer forma.t

          So at the script level, where you create Posting Date create another one using num()


          LOAD [Posting Date],

          num ( [Posting Date] ) as nPostingDate,

          other fields, etc


          from ... // you regular script


          Change your variable to

          =num(today() -120)


          Your final expression will be:

          sum({<[Posting Date] ={'>=$(vFecha)'} Venta)


          sum({<[Posting Date] ={'>=$(=vFecha)'} Venta)



          Hope it helps,