1 Reply Latest reply: Jan 11, 2012 5:04 PM by Miguel Angel Baeyens de Arce RSS

    Questions on Date Range Calendars

      I have been assisted in how to build the date range calendar, but I have a few questions.


      First question is  I had built my original with the following expresion:


      =sum(total <PurchaseOrderNumber,Item> ReceivedQuantity)


      but now that I am adding calendars to create the ability to select a date range I am adding the following:


      =Sum({< RequiredDate = {'>=$(=Date(vStartDate))<=$(=Date(vEndDate))'} >} ReceivedQuantity)


      In order for this to work, I am assuming that I need to combine these together somehow.  How do I does this?



      Second quesiton is when I am using the date range expression, do I have to but it on all expressions and dimenisions to make this work.  I noticed as I started to do this.  My date on each line seemed to get corrupted with a new date that didn't make sense.


      Thanks for your help.

        • Re: Questions on Date Range Calendars
          Miguel Angel Baeyens de Arce



          To your first question yes, you need to merge both expressions, and that should work just fine. This syntax is valid.


          Sum({< RequiredDate = {'>=$(=Date(vStartDate))<=$(=Date(vEndDate))'} >} TOTAL <PurchaseOrderNumber,Item> ReceivedQuantity)


          To your second question and as a general rule, yes, you need to use the same set analysis in all the expressions (not dimensions) of the chart, otherwise it might return null values (values in dimension that do not have matching aggregated expression values). Dimensions will only show matching values for the set specified, in your case above, values for dimensions where RequiredDate is between the values of vStartDate and vEndDate.


          But I don't understand what you mean by "date corrupted". Can you please share an example? Do you mean you see something like 40920 instead of "12/01/2012" ? If so, you will need to use the Date() function in your date field in the script.


          Hope that helps.