Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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!
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,
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?
Load script and yes both fields are in the same table.
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.
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'
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!
Thanks Jeremiah....It worked perfectly.