Focal Point
AMP VARIABLE

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

April 13, 2005, 04:29 PM
MADDY
AMP VARIABLE
HI GUYS,
IN MY REPORT I HAD DEFINED CUSTOMERID AS AMP VARIABLE THAT CAN HAVE NULL VALUE USING THE FOLLOWING CODE IN MRE. IT SHOULD BE SUCH THAT WHEN THE USER DOESNOT GIVE ANY VALUE TO CUSTOMERID THEN THE COLUMN SHOULDN'T BE DISPLAYED AND IT SHOULD BE DISPLAYED ONLY WHEN THE USER ENTERS A VALUE FOR THIS VARIABLE. HOW TO CHANGE MY CODE SO THAT THE ABOVE CONDITION SATISFIES THANKS FOR UR HELP
-SET &FILTER1 = IF &CUSID NE '' THEN 'WHERE CUSTOMERID EQ '''| &CUSID |'''' ELSE ' ';
TABLE FILE SQLOUT
PRINT
CUSTOMERNAME
&WHERE3
END
April 13, 2005, 04:41 PM
TexasStingray
isn't this the same a one of your other posts
April 13, 2005, 06:07 PM
susannah
your &WHERE3 needs to be &FILTER1.EVAL
and you can either test the length of customerid (&CUSTOMERID.LENGTH = 1 if it is empty...true, go figure)
or you can default a value , say, 'ALL' to customerid and then if the user overrides it, you put in a filter.
-SET &FILTER1 = IF &CUSTOMERID EQ 'ALL' THEN ' ' ELSE 'IF CUSTOMERID EQ ' | &CUSTOMERID ;