Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
tmumaw
Specialist II
Specialist II

Syntax issue

Help.  What is wrong with the following.....

if(Quote_Cancelled = '1' and
(
Opportunity.davey_HeaderCancelCode = '12' or
Opportunity.davey_HeaderCancelCode = '13' or
Opportunity.davey_HeaderCancelCode = '14' or
Opportunity.davey_HeaderCancelCode = '16'),0,1) as NoPrint,

Thanks    

1 Solution

Accepted Solutions
jerem1234
Specialist II
Specialist II

Use this script:

Opportunity:
Load *,
if(Len(Opportunity.Davey_SalesDocumentNumber) > 0 and Len(OpportunityLines) > 0,
Num(Opportunity.Davey_SalesDocumentNumber,'0000000000') &OpportunityLines) as %ContractItemKey,
if(Len(Opportunity.Davey_SalesDocumentNumber) = 0,'Q','R') as Status_R_Q,
if(Quote_Cancelled ='1' and Match(Opportunity.davey_HeaderCancelCode,'12','13','14','16'),0,1) as NoPrint
Resident Opportunity_Temp1;


Drop Table Opportunity_Temp1;


Hope this helps!

View solution in original post

7 Replies
jerem1234
Specialist II
Specialist II

Seems fine to me. You may be able to reduce the code a bit with:

if(Quote_Cancelled = '1' and match(Opportunity.davey_HeaderCancelCode, '12', '13', '14', '16'),0,1) as NoPrint,

Colin-Albert

Are you using this code in a chart or the script?

If in the script, are both fields in the same table that you are loading from?

tmumaw
Specialist II
Specialist II
Author

Load script and yes both fields are in the same table.

jerem1234
Specialist II
Specialist II

What error are you getting? and can you post the whole load statement? Might be something small like a comma where it shouldn't be or a missing semi-colon.

tmumaw
Specialist II
Specialist II
Author

Opportunity:
Load *,
if(Len(Opportunity.Davey_SalesDocumentNumber) > 0 and Len(OpportunityLines) > 0,
Num(Opportunity.Davey_SalesDocumentNumber,'0000000000') & OpportunityLines) as %ContractItemKey,
if(Len(Opportunity.Davey_SalesDocumentNumber) = 0,'Q','R') as Status_R_Q,
if(Quote_Cancelled = '1' and Match(Opportunity.davey_HeaderCancelCode = '12','13','14','16'),0,1) as NoPrint

Resident Opportunity_Temp1
;
Drop Table Opportunity_Temp1;

This made everything a '1'

jerem1234
Specialist II
Specialist II

Use this script:

Opportunity:
Load *,
if(Len(Opportunity.Davey_SalesDocumentNumber) > 0 and Len(OpportunityLines) > 0,
Num(Opportunity.Davey_SalesDocumentNumber,'0000000000') &OpportunityLines) as %ContractItemKey,
if(Len(Opportunity.Davey_SalesDocumentNumber) = 0,'Q','R') as Status_R_Q,
if(Quote_Cancelled ='1' and Match(Opportunity.davey_HeaderCancelCode,'12','13','14','16'),0,1) as NoPrint
Resident Opportunity_Temp1;


Drop Table Opportunity_Temp1;


Hope this helps!

tmumaw
Specialist II
Specialist II
Author

Thanks Jeremiah....It worked perfectly.