3 Replies Latest reply: Aug 19, 2011 12:21 PM by Oleg Troyansky RSS

    Date range in expression

    Gerhard Laubscher


      I am uploading daily files with one of the fields being "Effective Date".

      At the moment I have expressions like these:

      Sum ({$<[Effective Date]={"2011/04/10","2011/04/09","2011/04/08"},[Tran Code]={"35"}>}[Trans Amount])

      Can someone help me to put a "date-range" instead of the {"2011/04/10","2011/04/09","2011/04/08"}, so in this example it would be all dates from the 8th of April to the 10th of April.



        • Date range in expression
          Oleg Troyansky

          something like this:

          Sum ({$<[Effective Date]={"<=2011/04/10>=2011/04/08"},[Tran Code]={"35"}>}[Trans Amount])

          or, more parameter-driven:

          Sum ({$<[Effective Date]={"<=$(varFromDate)>=$(varToDate)"},[Tran Code]={"35"}>}[Trans Amount])

          where both variables are assigned the formatted date strings


          Side comment: I think you misunderstand the role of double quotes in SeT Analysis. Double quotes need to be used to signify search in a field, not individual values. So, if your [Tran Code] is numeric, no quotes are necessary, if it's a string, then single quotes are needed. You'd use double quotes if you wanted to search, for example, using a wildcard "35*"