Translating functions

iuphim

Registered User.
Local time
Today, 07:55
Joined
Oct 30, 2008
Messages
43
Hi I inherited this long expression and I'm having trouble understanding the functions used. Can someone help me translate as to what it is doing?

Future Sell Price Est: IIf([Price Code Formula] In ("Cost","PR1","PR2","PR3","2xCost","Cost Plus","2X Cost Plus"),Switch([Price Code Formula]="Cost",[Future Cost],[Price Code Formula]="PR1",[Future PR1],[Price Code Formula]="PR2",[Future PR2],[Price Code Formula]="PR3",[Future PR3],[Price Code Formula]="2xCOST",[Future Cost]*2,[Price Code Formula]="Cost Plus",[Future Cost]*(1+[Current Cost Plus %]),[Price Code Formula]="2X Cost Plus",(2*[Future Cost])*(1*[Current Cost margin])),IIf([Price Code Formula] In ("Fixed Plus","Best Cost Plus"),Switch([Price Code Formula]="Fixed Plus",[Current Sell Price],[Price Code Formula]="Best Cost Plus",[Future Cost]*(1+[Current Cost Plus %])),"Can't Determine"))

and

Future Sell Price Estimate: CCur(IIf(IsNumeric([Future Sell Price Est])=-1,[Future Sell Price Est],Switch([Price Code Formula]="PR3 Plus",[Future PR3],[Price Code Formula]="PR2 Plus",[Future PR2],[Price Code Formula]="PR3 Less",[Future PR3],[Price Code Formula]="PR2 Less",[Future PR2],[Price Code Formula]="Cost Plus (Margin)",IIf([Cost % Change]<0,[Current Sell Price],[Future Cost]/(1-[Current Cost Margin])),True,[Future PR1])))

and what's abs().




Thanks!
 
I have reformatted your two expressions in a way that I hope is much easier to understand. Rather that go into detail as to the use and purpose of each of the functions, I ask that you check the link below to review the purpose and implementation of the Functions (listed in RED), and post back if you have any unswered questions.

http://www.techonthenet.com/access/functions/

Code:
[FONT=Times New Roman][SIZE=3]Future Sell Price Est: [/SIZE][/FONT]
[SIZE=3][FONT=Times New Roman]  [COLOR=red][B]IIf[/B][/COLOR]([/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]      [Price Code Formula] [COLOR=red][B]In[/B][/COLOR] ("Cost","PR1","PR2","PR3","2xCost","Cost Plus","2X Cost Plus"),[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]      [COLOR=red][B]Switch[/B][/COLOR]([Price Code Formula]="Cost",[Future Cost],[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                  [Price Code Formula]="PR1",[Future PR1], [/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                  [Price Code Formula]="PR2",[Future PR2], [/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                  [Price Code Formula]="PR3",[Future PR3], [/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                  [Price Code Formula]="2xCOST",[Future Cost]*2, [/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                  [Price Code Formula]="Cost Plus",[Future Cost]*(1+[Current Cost Plus %]),[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                  [Price Code Formula]="2X Cost Plus",(2*[Future Cost])*(1*[Current Cost margin])), [/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]      [COLOR=red][B]IIf[/B][/COLOR]([Price Code Formula] In ("Fixed Plus","Best Cost Plus"),[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]            [COLOR=red][B]Switch[/B][/COLOR]([Price Code Formula]="Fixed Plus",[Current Sell Price],[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        [Price Code Formula]="Best Cost Plus",[Future Cost]*(1+[Current Cost Plus %])),[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                        "Can't Determine"))[/FONT][/SIZE]
 
[SIZE=3][FONT=Times New Roman]and[/FONT][/SIZE]
 
[FONT=Times New Roman][SIZE=3]Future Sell Price Estimate: [/SIZE][/FONT]
[SIZE=3][FONT=Times New Roman]  [COLOR=red][B]CCur[/B][/COLOR]([COLOR=red][B]IIf[/B][/COLOR]([COLOR=red][B]IsNumeric[/B][/COLOR]([Future Sell Price Est])=-1,[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                 [Future Sell Price Est],[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                 [COLOR=red][B]Switch[/B][/COLOR]([Price Code Formula]="PR3 Plus",[Future PR3],[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                             [Price Code Formula]="PR2 Plus",[Future PR2],[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                             [Price Code Formula]="PR3 Less",[Future PR3],[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                             [Price Code Formula]="PR2 Less",[Future PR2],[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                             [Price Code Formula]="Cost Plus (Margin)",[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                 [COLOR=red][B]IIf[/B][/COLOR]([Cost % Change]<0,[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                      [Current Sell Price],[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                                      [Future Cost]/(1-[Current Cost Margin])),[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]                             True,[Future PR1])))[/FONT][/SIZE]
 
[FONT=Times New Roman][SIZE=3]and what's [COLOR=red][B]abs[/B][/COLOR]().[/SIZE][/FONT]
 

Users who are viewing this thread

Back
Top Bottom