Focal Point
[Solved]LIKE operator in Where

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2407099096

December 18, 2018, 04:02 PM
srajeevan
[Solved]LIKE operator in Where
Hi,

I have a requirement where i need to use LIKE operator in where clause.
I figured out how to use it.
  
--other where clause--
AND DIM_LOCATION.ADDRESS_LINE_1 LIKE '%&ADDRESS|%'

The address parameter is not a mandatory input and if the user is not filtering for Address it will pass _FOC_NULL and in that case
my whole report given empty data because the where clause filter for

  
--other where clause--
AND DIM_LOCATION.ADDRESS_LINE_1 LIKE '%_FOC_NULL%'


I think it should be
AND DIM_LOCATION.ADDRESS_LINE_1 LIKE '%_FOC_NULL%',but when the user filters for some address then it should be AND.

Any logical workaround to tackle this situation?

This message has been edited. Last edited by: srajeevan,


WF8206,Windows 7,8,10
HTM,PDF,EXCEL
December 18, 2018, 04:06 PM
BabakNYC
Can you use a second WHERE ADDRESSLINE LIKE instead of using AND? That way what happens to the second where test doesn't effect the first one.
  
WHERE first condition;
-IF &ADDRESS EQ _FOC_NULL GOTO SKIP;
WHERE second condition;
-SKIP



WebFOCUS 8206, Unix, Windows
December 18, 2018, 05:16 PM
srajeevan
Thanks BabakNYC it worked.


WF8206,Windows 7,8,10
HTM,PDF,EXCEL