Formula Creation (Array Subscripting) On Month (1 Viewer)

lhooker

Registered User.
Local time
Today, 14:11
Joined
Dec 30, 2005
Messages
405
I'm trying to write a formula that will retrieve the current month (i.e return 1 for January, 2 for Feburary . . etc). Once I have the month number, I want to retrieve one of the values in the Goal_Salary_A array based on the month
number (i.e. 500000 for the month of June). I have part of it, but I'm having trouble the date/subscripting portion. I don't believe that double subscripting is allow (i.e Goal_Salable[n], where "n" is the month. I placed numeric values
in the subscripts below to verify that the "Select" statement and "Subscripting" portion works. Below is what I have so far. Can someone take a look at this and let me know how to complete this formula ? Thanks ! ! !

NumberVar Array Goal_Salable_A := MakeArray (533333, 633333, 733333, 300000, 400000, 500000, 600000, 700000, 800000, 545333, 578333, 538883);
NumberVar Mnth;
DateVar Mydate;
Mnth = 0;
MyDate = CurrentDate;
Select {Salesman}
Case "Gordon Thomas":
Goal_Salable_A[6]
Case "Cliff Burns":
Goal_Salable_A[12]
 

lhooker

Registered User.
Local time
Today, 14:11
Joined
Dec 30, 2005
Messages
405
I solved my problem, Below is the solution . . .

NumberVar Array Goal_Salable_A := MakeArray (533333, 633333, 733333, 300000, 400000, 500000, 600000, 700000, 800000, 545333, 578333, 538883);
Select {Salesman}
Case "Gordon Thomas":
If {@Goal_Month} = 6 Then Goal_Salable_A[6]
Case "Cliff Burns":
If {@Goal_Month} = 6 Then Goal_Salable_A[6]


Goal_Month (Formula)
--------------------
DatePart("m", currentdate)
 

Users who are viewing this thread

Top Bottom