Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Error: An expression cannot end with an operator!!!

vtika16
7 - Meteor

IF [Warehouse Graded Date]>= #9/31/2016# && [Warehouse Graded Date]<= #10/31/2016# && [Warehouse_Grade] = 'A' && [Warehouse_Grade] = 'B' && [Warehouse_Grade] = 'C' THEN 'Received - Qualified'

ELSEIF [Warehouse Graded Date]>=9/31/2016 && [Warehouse Graded Date]<=10/31/2016 && [Warehouse_Grade] = 'D' && [Warehouse_Grade] = 'E' && [Warehouse_Grade] = 'BER' THEN 'Received - Not Qualified'

ELSEIF [Puerto_Rico_IND] = 0 && Contains([Lease_Event], "Purchase") && [SPT_PPO_Percent_PaidAdjusted
] >= 1 && isempty([Warehouse_Receipt_Date]) THEN 'PPO'

ELSEIF[Puerto_Rico_IND] = 0 && ISEMPTY([Warehouse_Receipt_Date]) && Contains([Percent_PPO_Paid_Bucket], '100%+') && Contains([Lease_Status], 'Closed') OR Contains([Lease_Status], 'Cancelled)

ELSE ''

 

Can anyone help as to why this is the case???

4 REPLIES 4
jdunkerley79
ACE Emeritus
ACE Emeritus

You need an ENDIF to close the IF clause

vtika16
7 - Meteor

Thanks for the input! I tried it, and still having that error. It is specific to (Expression #1) it says. I am trying to filter based on date criteria and grade type

Joe_Mako
12 - Quasar

There were many issues (missing quote marks, using # instead of quote marks, non ISO date format, poor logic of AND with multiple same field values, missing a THEN statement, and so on), so I went through and cleaned it all up.

 

You will want to check the logic to ensure it matches your expectations, and where I put "Something", you will want to change that to what you would like the result to be.

 

IF [Warehouse Graded Date] >= '2016-09-31' 
AND [Warehouse Graded Date] <= '2016-10-31' 
AND ([Warehouse_Grade] = 'A' 
OR [Warehouse_Grade] = 'B' 
OR [Warehouse_Grade] = 'C') 
THEN 'Received - Qualified'

ELSEIF [Warehouse Graded Date] >= '2016-09-31' 
AND [Warehouse Graded Date] <= '2016-10-31' 
AND ([Warehouse_Grade] = 'D' 
OR [Warehouse_Grade] = 'E' 
OR [Warehouse_Grade] = 'BER') 
THEN 'Received - Not Qualified'

ELSEIF [Puerto_Rico_IND] = 0 
AND Contains([Lease_Event], 'Purchase') 
AND [SPT_PPO_Percent_PaidAdjusted] >= 1 
AND IsEmpty([Warehouse_Receipt_Date]) 
THEN 'PPO' ELSEIF [Puerto_Rico_IND] = 0 AND IsEmpty([Warehouse_Receipt_Date]) AND Contains([Percent_PPO_Paid_Bucket], '100%+') AND (Contains([Lease_Status], 'Closed') OR Contains([Lease_Status], 'Cancelled')) THEN 'Something' ELSE 'NULL' ENDIF

 

 

vtika16
7 - Meteor

wow! thank you! this is my second day using it, so I am still on a learning curve. Thank you!

Labels