BAQ: 'Skip Condition If Empty' Not Working for Name Parameters in Kinetic – Anyone Got This Working?

Has anyone successfully gotten Skip Condition If Empty to work for BAQ parameters in Kinetic?

I’m working on a customer name lookup BAQ, where I:

  1. First check for an exact match on @IDP_FullName.
  2. Only if that fails, perform a LIKE search using @IDP_FirstName and @IDP_LastName.

However, when I run the query with @IDP_FirstName and @IDP_LastName empty, I get a “Bad SQL statement” error instead of the condition being skipped.

I have Skip Condition If Empty checked for @IDP_FirstName and @IDP_LastName (see screenshot), but it doesn’t seem to work as expected.

Where clause from BAQ:
from Erp.CustCnt as [CustCnt]
where ((CustCnt.Company = @CompanyID
and CustCnt.ShipToNum = ‘’ )
and (CustCnt.Name = @IDP_FullName
or CustCnt.Name LIKE ‘%’ + @IDP_FirstName + ‘%’ + @IDP_LastName + ‘%’ ))

Only thing that jumps out…both Mandatory and Skip Condition If Empty are checked…if it’s a mandatory entry then it can’t be empty.

3 Likes

I think it only skips the simple condition, like value=@parametername

I think what I did last week in Classic could work for this. I was hitting the same bad sql issue and went with using the parameters with like in an expression, so if it is empty it is like ‘%%’ and not skipped but always true.

1 Like