HELP! BAQ Calculated field sytax error

From what ive tried...not too well..seems very limited, but then again I
haven't ran through them all.



Rob Bucek

Manufacturing Engineer

PH: (715) 284-5376 ext 3111

FAX: (715)284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site) <http://www.dsmfg.com/>





From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Brian W. Spolarich
Sent: Thursday, July 16, 2009 8:36 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] HELP! BAQ Calculated field sytax error





Can someone educate me as to how the syntax of the BAQ calculated field
statements relates to the ABL/4GL syntax defined in the Reference Guide
and handbook on the Progress web site?

-bws

--
Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix /
Picometrix
bspolarich@...
<mailto:bspolarich%40advancedphotonix.com> ~ 734-864-5618 ~
www.advancedphotonix.com

-----Original Message-----
From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf Of Gary Parfrey
Sent: Thursday, July 16, 2009 9:31 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] HELP! BAQ Calculated field sytax error

You do not need the end statements. Remove them and just use the nested
if then else statements

Gary

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Dan Godfrey
Sent: 15 July 2009 18:17
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] HELP! BAQ Calculated field sytax error

I thought about that and it does not make a difference here. I have
even tried parenthesis around the conditions, like the following to no
avail.

If (PartRev.TLRMaterialCost > 0.0) Then
(PartMtl.QtyPer * PartRev.TLRMaterialCost)
Else
If (PartPlant.CostMethod = 'S') Then
(PartMtl.QtyPer * PartCost.StdMaterialCost)
Else
(PartMtl.QtyPer * PartCost.AvgMaterialCost)
End.
End.

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Mark Wonsil
Sent: Wednesday, July 15, 2009 10:10 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] HELP! BAQ Calculated field sytax error

Dan wrote:
> this is my code in a calculated field of a BAQ. I get a
> syntax error. I can not see the error.
>
> If PartRev.TLRMaterialCost > 0.0 Then
> (PartMtl.QtyPer * PartRev.TLRMaterialCost)
> Else
> If PartPlant.CostMethod = 'S' Then
> (PartMtl.QtyPer * PartCost.StdMaterialCost)
> Else
> (PartMtl.QtyPer * PartCost.AvgMaterialCost)
> End
> End.

Try adding a period to your second to last End.

If not, copy and paste the formula into Notepad. Start with a simple
statement and then add items until you get an error.

Mark W.

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

------------------------------------

Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must
have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder
and Crystal Reports and other 'goodies', please goto:
http://groups.yahoo.com/group/vantage/files/.
<http://groups.yahoo.com/group/vantage/files/>
(2) To search through old msg's goto:
http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto:
http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links





[Non-text portions of this message have been removed]
this is my code in a calculated field of a BAQ. I get a syntax error. I can not see the error.


If PartRev.TLRMaterialCost > 0.0 Then
(PartMtl.QtyPer * PartRev.TLRMaterialCost)
Else
If PartPlant.CostMethod = 'S' Then
(PartMtl.QtyPer * PartCost.StdMaterialCost)
Else
(PartMtl.QtyPer * PartCost.AvgMaterialCost)
End
End.

Dan Godfrey
Dan wrote:
> this is my code in a calculated field of a BAQ. I get a
> syntax error. I can not see the error.
>
> If PartRev.TLRMaterialCost > 0.0 Then
> (PartMtl.QtyPer * PartRev.TLRMaterialCost)
> Else
> If PartPlant.CostMethod = 'S' Then
> (PartMtl.QtyPer * PartCost.StdMaterialCost)
> Else
> (PartMtl.QtyPer * PartCost.AvgMaterialCost)
> End
> End.

Try adding a period to your second to last End.

If not, copy and paste the formula into Notepad. Start with a simple
statement and then add items until you get an error.

Mark W.
I thought about that and it does not make a difference here. I have
even tried parenthesis around the conditions, like the following to no
avail.

If (PartRev.TLRMaterialCost > 0.0) Then
(PartMtl.QtyPer * PartRev.TLRMaterialCost)
Else
If (PartPlant.CostMethod = 'S') Then
(PartMtl.QtyPer * PartCost.StdMaterialCost)
Else
(PartMtl.QtyPer * PartCost.AvgMaterialCost)
End.
End.

________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Mark Wonsil
Sent: Wednesday, July 15, 2009 10:10 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] HELP! BAQ Calculated field sytax error





Dan wrote:
> this is my code in a calculated field of a BAQ. I get a
> syntax error. I can not see the error.
>
> If PartRev.TLRMaterialCost > 0.0 Then
> (PartMtl.QtyPer * PartRev.TLRMaterialCost)
> Else
> If PartPlant.CostMethod = 'S' Then
> (PartMtl.QtyPer * PartCost.StdMaterialCost)
> Else
> (PartMtl.QtyPer * PartCost.AvgMaterialCost)
> End
> End.

Try adding a period to your second to last End.

If not, copy and paste the formula into Notepad. Start with a simple
statement and then add items until you get an error.

Mark W.






[Non-text portions of this message have been removed]
Try using double quotes around the "S" in your PartPlant.CostMethod



Chris



_____

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Dan Godfrey
Sent: Wednesday, July 15, 2009 10:17 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] HELP! BAQ Calculated field sytax error








I thought about that and it does not make a difference here. I have
even tried parenthesis around the conditions, like the following to no
avail.

If (PartRev.TLRMaterialCost > 0.0) Then
(PartMtl.QtyPer * PartRev.TLRMaterialCost)
Else
If (PartPlant.CostMethod = 'S') Then
(PartMtl.QtyPer * PartCost.StdMaterialCost)
Else
(PartMtl.QtyPer * PartCost.AvgMaterialCost)
End.
End.

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Mark Wonsil
Sent: Wednesday, July 15, 2009 10:10 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] HELP! BAQ Calculated field sytax error

Dan wrote:
> this is my code in a calculated field of a BAQ. I get a
> syntax error. I can not see the error.
>
> If PartRev.TLRMaterialCost > 0.0 Then
> (PartMtl.QtyPer * PartRev.TLRMaterialCost)
> Else
> If PartPlant.CostMethod = 'S' Then
> (PartMtl.QtyPer * PartCost.StdMaterialCost)
> Else
> (PartMtl.QtyPer * PartCost.AvgMaterialCost)
> End
> End.

Try adding a period to your second to last End.

If not, copy and paste the formula into Notepad. Start with a simple
statement and then add items until you get an error.

Mark W.

[Non-text portions of this message have been removed]





[Non-text portions of this message have been removed]
Tried it. Thank you, but it didn't work.

________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Chris Crosta
Sent: Wednesday, July 15, 2009 10:26 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] HELP! BAQ Calculated field sytax error





Try using double quotes around the "S" in your PartPlant.CostMethod

Chris

_____

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Dan Godfrey
Sent: Wednesday, July 15, 2009 10:17 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] HELP! BAQ Calculated field sytax error

I thought about that and it does not make a difference here. I have
even tried parenthesis around the conditions, like the following to no
avail.

If (PartRev.TLRMaterialCost > 0.0) Then
(PartMtl.QtyPer * PartRev.TLRMaterialCost)
Else
If (PartPlant.CostMethod = 'S') Then
(PartMtl.QtyPer * PartCost.StdMaterialCost)
Else
(PartMtl.QtyPer * PartCost.AvgMaterialCost)
End.
End.

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Mark Wonsil
Sent: Wednesday, July 15, 2009 10:10 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] HELP! BAQ Calculated field sytax error

Dan wrote:
> this is my code in a calculated field of a BAQ. I get a
> syntax error. I can not see the error.
>
> If PartRev.TLRMaterialCost > 0.0 Then
> (PartMtl.QtyPer * PartRev.TLRMaterialCost)
> Else
> If PartPlant.CostMethod = 'S' Then
> (PartMtl.QtyPer * PartCost.StdMaterialCost)
> Else
> (PartMtl.QtyPer * PartCost.AvgMaterialCost)
> End
> End.

Try adding a period to your second to last End.

If not, copy and paste the formula into Notepad. Start with a simple
statement and then add items until you get an error.

Mark W.

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]






[Non-text portions of this message have been removed]
Take a look at page 687 of the Progress 4GL Reference.

http://www.progress.com/progress/products/documentation/docs/dvref/dvref.pdf

It shows this example of IF/THEN/ELSE:

IF ship-date = ? THEN DO:
IF promise-date = ? THEN DO:
MESSAGE "Please update the promise date.".
REPEAT WHILE promise-date = ?:
UPDATE promise-date WITH FRAME oinfo.
END.
END.
ans = FALSE.
MESSAGE "Has this order been shipped?" UPDATE ans.
IF ans
THEN REPEAT WHILE ship-date = ?:
UPDATE ship-date WITH FRAME oinfo.
END.
END.
ELSE DO:
ans = TRUE.
MESSAGE "Has this order been paid?" UPDATE ans.
IF NOT ans THEN DO:
DISPLAY STREAM due order-num TO 14 name AT 18
order-date AT 42 ship-date AT 54
WITH NO-BOX DOWN FRAME unpaid.
END.
END.

Maybe your example should be:

If (PartRev.TLRMaterialCost > 0.0) Then Do:
(PartMtl.QtyPer * PartRev.TLRMaterialCost)
End.
Else Do:
If (PartPlant.CostMethod = 'S') Then Do:
(PartMtl.QtyPer * PartCost.StdMaterialCost)
End.
Else Do:
(PartMtl.QtyPer * PartCost.AvgMaterialCost)
End.
End.

I'm probably off-base here though. I just happened to be looking at this exact thing for something I just did.

(here's the handbook)

http://www.progress.com/progress/products/documentation/docs/dvhbk/dvhbk.pdf

-bws
--
Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix / Picometrix
    bspolarich@... ~ 734-864-5618 ~ www.advancedphotonix.com


-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Dan Godfrey
Sent: Wednesday, July 15, 2009 1:17 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] HELP! BAQ Calculated field sytax error

I thought about that and it does not make a difference here. I have
even tried parenthesis around the conditions, like the following to no
avail.

If (PartRev.TLRMaterialCost > 0.0) Then
(PartMtl.QtyPer * PartRev.TLRMaterialCost)
Else
If (PartPlant.CostMethod = 'S') Then
(PartMtl.QtyPer * PartCost.StdMaterialCost)
Else
(PartMtl.QtyPer * PartCost.AvgMaterialCost)
End.
End.

________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Mark Wonsil
Sent: Wednesday, July 15, 2009 10:10 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] HELP! BAQ Calculated field sytax error





Dan wrote:
> this is my code in a calculated field of a BAQ. I get a
> syntax error. I can not see the error.
>
> If PartRev.TLRMaterialCost > 0.0 Then
> (PartMtl.QtyPer * PartRev.TLRMaterialCost)
> Else
> If PartPlant.CostMethod = 'S' Then
> (PartMtl.QtyPer * PartCost.StdMaterialCost)
> Else
> (PartMtl.QtyPer * PartCost.AvgMaterialCost)
> End
> End.

Try adding a period to your second to last End.

If not, copy and paste the formula into Notepad. Start with a simple
statement and then add items until you get an error.

Mark W.






[Non-text portions of this message have been removed]



------------------------------------

Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.
(2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links
> If (PartRev.TLRMaterialCost > 0.0) Then
> (PartMtl.QtyPer * PartRev.TLRMaterialCost)
> Else
> If (PartPlant.CostMethod = 'S') Then
> (PartMtl.QtyPer * PartCost.StdMaterialCost)
> Else
> (PartMtl.QtyPer * PartCost.AvgMaterialCost)
> End.
> End.

Try no periods at all. I got that to work (in Epicor 9 anyway...)

Mark W.
Here is an example of a couple working nested if then else statement I
have..perhaps theres something in there of use..



if labordtl.labortype="I" then if labordtl.indirectcode="PMB" then 0
else if labordtl.indirectcode="STB" then 0 else labordtl.laborhrs else 0



if labordtl.labortype="I" then if labordtl.indirectcode="PMB" then 0
else if labordtl.indirectcode="STB" then 0 else labordtl.laborhrs *
EmpBasic.LaborRate else 0



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Mark Wonsil
Sent: Wednesday, July 15, 2009 12:35 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] HELP! BAQ Calculated field sytax error





> If (PartRev.TLRMaterialCost > 0.0) Then
> (PartMtl.QtyPer * PartRev.TLRMaterialCost)
> Else
> If (PartPlant.CostMethod = 'S') Then
> (PartMtl.QtyPer * PartCost.StdMaterialCost)
> Else
> (PartMtl.QtyPer * PartCost.AvgMaterialCost)
> End.
> End.

Try no periods at all. I got that to work (in Epicor 9 anyway...)

Mark W.





[Non-text portions of this message have been removed]
Thank you all for helping. With all of the advice coming in, I tried to
combine them all and I came up with this.

If (PartRev.TLRMaterialCost > 0.0) Then
(PartMtl.QtyPer * PartRev.TLRMaterialCost)
Else If (PartPlant.CostMethod = "S") Then
(PartMtl.QtyPer * PartCost.StdMaterialCost)
Else
(PartMtl.QtyPer * PartCost.AvgMaterialCost)

It works. So thank you all.

Dan

________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Rob Bucek
Sent: Wednesday, July 15, 2009 10:47 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] HELP! BAQ Calculated field sytax error





Here is an example of a couple working nested if then else statement I
have..perhaps theres something in there of use..

if labordtl.labortype="I" then if labordtl.indirectcode="PMB" then 0
else if labordtl.indirectcode="STB" then 0 else labordtl.laborhrs else 0

if labordtl.labortype="I" then if labordtl.indirectcode="PMB" then 0
else if labordtl.indirectcode="STB" then 0 else labordtl.laborhrs *
EmpBasic.LaborRate else 0

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Mark Wonsil
Sent: Wednesday, July 15, 2009 12:35 PM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] HELP! BAQ Calculated field sytax error

> If (PartRev.TLRMaterialCost > 0.0) Then
> (PartMtl.QtyPer * PartRev.TLRMaterialCost)
> Else
> If (PartPlant.CostMethod = 'S') Then
> (PartMtl.QtyPer * PartCost.StdMaterialCost)
> Else
> (PartMtl.QtyPer * PartCost.AvgMaterialCost)
> End.
> End.

Try no periods at all. I got that to work (in Epicor 9 anyway...)

Mark W.

[Non-text portions of this message have been removed]






[Non-text portions of this message have been removed]
You do not need the end statements. Remove them and just use the nested
if then else statements



Gary



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Dan Godfrey
Sent: 15 July 2009 18:17
To: vantage@yahoogroups.com
Subject: RE: [Vantage] HELP! BAQ Calculated field sytax error








I thought about that and it does not make a difference here. I have
even tried parenthesis around the conditions, like the following to no
avail.

If (PartRev.TLRMaterialCost > 0.0) Then
(PartMtl.QtyPer * PartRev.TLRMaterialCost)
Else
If (PartPlant.CostMethod = 'S') Then
(PartMtl.QtyPer * PartCost.StdMaterialCost)
Else
(PartMtl.QtyPer * PartCost.AvgMaterialCost)
End.
End.

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Mark Wonsil
Sent: Wednesday, July 15, 2009 10:10 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] HELP! BAQ Calculated field sytax error

Dan wrote:
> this is my code in a calculated field of a BAQ. I get a
> syntax error. I can not see the error.
>
> If PartRev.TLRMaterialCost > 0.0 Then
> (PartMtl.QtyPer * PartRev.TLRMaterialCost)
> Else
> If PartPlant.CostMethod = 'S' Then
> (PartMtl.QtyPer * PartCost.StdMaterialCost)
> Else
> (PartMtl.QtyPer * PartCost.AvgMaterialCost)
> End
> End.

Try adding a period to your second to last End.

If not, copy and paste the formula into Notepad. Start with a simple
statement and then add items until you get an error.

Mark W.

[Non-text portions of this message have been removed]





[Non-text portions of this message have been removed]
Can someone educate me as to how the syntax of the BAQ calculated field statements relates to the ABL/4GL syntax defined in the Reference Guide and handbook on the Progress web site?

-bws

--
Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix / Picometrix
    bspolarich@... ~ 734-864-5618 ~ www.advancedphotonix.com


-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Gary Parfrey
Sent: Thursday, July 16, 2009 9:31 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] HELP! BAQ Calculated field sytax error

You do not need the end statements. Remove them and just use the nested
if then else statements



Gary



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Dan Godfrey
Sent: 15 July 2009 18:17
To: vantage@yahoogroups.com
Subject: RE: [Vantage] HELP! BAQ Calculated field sytax error








I thought about that and it does not make a difference here. I have
even tried parenthesis around the conditions, like the following to no
avail.

If (PartRev.TLRMaterialCost > 0.0) Then
(PartMtl.QtyPer * PartRev.TLRMaterialCost)
Else
If (PartPlant.CostMethod = 'S') Then
(PartMtl.QtyPer * PartCost.StdMaterialCost)
Else
(PartMtl.QtyPer * PartCost.AvgMaterialCost)
End.
End.

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Mark Wonsil
Sent: Wednesday, July 15, 2009 10:10 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] HELP! BAQ Calculated field sytax error

Dan wrote:
> this is my code in a calculated field of a BAQ. I get a
> syntax error. I can not see the error.
>
> If PartRev.TLRMaterialCost > 0.0 Then
> (PartMtl.QtyPer * PartRev.TLRMaterialCost)
> Else
> If PartPlant.CostMethod = 'S' Then
> (PartMtl.QtyPer * PartCost.StdMaterialCost)
> Else
> (PartMtl.QtyPer * PartCost.AvgMaterialCost)
> End
> End.

Try adding a period to your second to last End.

If not, copy and paste the formula into Notepad. Start with a simple
statement and then add items until you get an error.

Mark W.

[Non-text portions of this message have been removed]





[Non-text portions of this message have been removed]



------------------------------------

Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.
(2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links