July 25, 2006, 02:03 PM
funsuttonmathmatically changing amper value
I am wanting to do a drill down report for the last 5 years for a given date. Is there a way using the dialouge manager (or other method) for chaning an amper value mathmatically?
For example, our Aid year is 0607 (2006-2007). So last year's aid year would be 0506, subtracting 101. I've tried this in the dialouge manager, however it doesn't seem to do math very well.
Brian
July 25, 2006, 02:14 PM
dwfI'm confused, Brian. That should work. Can you post your code?
July 25, 2006, 02:20 PM
funsuttonHi.
This is what I was trying to use:
-DEFAULT &AID_YEAR = 0607
-SET &AID_YEAR = &AID_YEAR - 101
Brian
July 25, 2006, 02:23 PM
dwfIf that's an extract, create a program that has just that code and add this line
-TYPE &AID_YEAR
Should display 506.
If your problem is the missing leading zero, you can fix that with a little extra code.
July 25, 2006, 02:23 PM
Francis Mariani-SET &C_AIDYEAR = 0607;
-SET &L_AIDYEAR1 = &C_AIDYEAR + 10000 - 101;
-SET &L_AIDYEAR = EDIT(&L_AIDYEAR1,'$9999');
-TYPE CURRENT YEAR: &C_AIDYEAR / LAST YEAR: &L_AIDYEAR
Since your Dialog Manager starts with a zero, it drops when you use it in math. I add an amount that is one zero more than the result you're expecting and then edit out that position. (Is this English?! I hope I was clear enough in the code).
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
July 25, 2006, 02:36 PM
funsuttonThanks guys.
Francis, that works great. I appreciate it.
Brian