Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to create a Calendar in the following type?

Hi,

I need to create a calendar so that i can make an ad-hoc range selection when viewing the report.

the data i have is  as follows:

Material     Month          Order#

M01          2012-01        540    

M01          2012-02        560         

M01          2012-03        640      

M01          2012-04        580      

M01          2012-05        510

M02          2012-01        340    

M02          2012-02        360         

M02          2012-03        140      

M02          2012-04        580      

M02          2012-05        810 

and the I can imagine that the calendat i need for start month and endmonth should be like this:

   2012

Jan  Feb Mar Apr

May Jun Jul   Aug

Sep Oct Nov Dec

Could you pls help?

Regards

Jerry

4 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Jerry

The simplest way to this is to use two variables, say vMinDate and vMaxDate and allow the user to enter these via an input box or calendar. Then use these variables in your expressions. Lets assume you use calendar boxes for the time being (we can refine that later):

Lets assume when you loaded month it was loaded as a datefield:

     LOAD...

          Date(Date#(Month, 'YYYY-MM'), 'YYYY-MM') As Month

Something like:  

Sum({<Month = {">=$(=Date('$vMinDate)', 'YYYY-MM')) <=$(=Date('$vMinDate)', 'YYYY-MM'))"} Amount)

(Check for closing brackets etc).

I think that's right. The date manipulation is because you are not using a standard date format. If you upload a sample of your model, I could test this in place and get it working for you.

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Hi Jonathan,

So kind of you.

I have practiced an example and

I have tried the expression to display

Sum({<Month = {">=$(=Date('$vMinDate)', 'YYYY-MM')) <=$(=Date('$vMinDate)', 'YYYY-MM'))"} Amount)

however, i failed.

could you pls help?

Regard

Jerry

jonathandienst
Partner - Champion III
Partner - Champion III

Jerry

Not sure where you tried the expression, but as this model bears little in common with your original post, its not surprising that it does not work.

There were also some syntax errors in my post , my bad!

Here's the solution.

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Hi Jonathan,

can't run it, still trying to find the solution.

anyway, thanks for your kindly help