I can't seem to create a dynamic WHERE clause with a SET variable.
Here is my code:
-SET &W_WHERE = IF &W_TYRE_ID EQ '1' AND &W_SORT_ID EQ '1' THEN 'WHERE D_LEVF_ID EQ '&D_LEVF_ID';';
To be used in:
TABLE FILE CSD_SLOB
SUM
&SUMX
BY &TYPE_SORT
ON TABLE COLUMN-TOTAL AS 'TOTAL'
&W_WHERE
If I use THEN 'WHERE D_LEVF_ID EQ '&D_LEVF_ID';';
then I the value for &D_LEVF_ID is shown and the set command works, but the actual WHERE clause gives the error:
(FOC257) MISSING QUOTE MARKS: 'WHERE D_LEVF_ID EQ
If I use THEN 'WHERE D_LEVF_ID EQ &D_LEVF_ID;';
then I get the error:
(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: &D_LEVF_ID
I can create the SUM and BY variably, but as soon as the SET VARIABLE enters the equation... no luck.
Anyone have any clues?
p.s. Only just started using WEBFOCUS, so please keep any ideas easy!!