Scenario : We are many scenario where we need to calculate no of days/month/years from given date range or month/year range.

Our fast approach is to write a CMOD and calculate the difference…. But best approach is to avoid code help…

A Difference of month based on the user input interval on the variable selection screen.

Say for Eg: if user input is 01.2012 to 03.2013 so the difference would be 15 Months.

So now i will going to sharing the same approach with step by step method:

Step 1 : Create a new formula —> Under that you have folder named as formula variable :–>Right click on it :

–>New variable:Given the details as wrote below.

created on DIFF Month , choose time characteristic based on your requirement.

Give description and technical name .

Type of Variable : Formula

processiing by Replacement path.

Reference characteristic : 0calmonth.

1.JPG

Step 2 :  click replacement path tab and give the details .

Replacement variable with : Variable.

Variable : 0I_CALMO (for month difference ) and 0I_DAYIN (for day difference) and 0I_CALYEAR (for year difference).

and reference characteristic : DATE characteristics.

processiing by Replacement path.

In theUse interval section choose Difference radio buttn.

2.JPG

Step 3:

In the currency/Unit tab choose dimension as Number.

Step 4:-Save this formula variable and Drag and drop into formula.Refer the screenshot.

4.JPG

Save the query and now let’s execute the query and check the results.

5.JPG

So as you can see that based on the input in variable selection screen we got the difference of Months.

Hope this might be useful.

Regards
Sandeep
To report this post you need to login first.

10 Comments

You must be Logged on to comment or reply to a post.

    1. Sandeep a Post author

      hi harshawardhan,

      You need to calculate some personnel metrics like equivalent labor class  The formula is to take the the total number of absences and divide by the number of available work days (the client doesn’t have the system calendar set to give work days, and they change the number of work days at report execution time

      Regards

      sandeep

      (0) 

Leave a Reply