I want to display all the data when the input parameter is left empty.
I am able to make it work with the following code in the filter expression in the calculation view. However, when I pass a value in the input parameter, it does not work.
if('$$CTUSER$$' = '',match("USER",'*'),in("USER", '$$CTUSER$$'))
Note that there are single quotes around $$IP_DE_CTUSER$$.
When I remove the single quotes around $$ IP_DE_CTUSER $$ as follows, the passed value is filtered correctly, but when the parameter is left blank, it does not work.
if($$CTUSER$$ = '',match("USER",'*'),in("USER", $$CTUSER$$))
What am I doing wrong? How I can make it work?
Below are my test data:
CREATE COLUMN TABLE TEST_IP_FILTER (
RESQTSN VARCHAR(30),COL1 VARCHAR(1),COL2 VARCHAR(1),COL3 VARCHAR(1),COL4 VARCHAR(1),COL5 VARCHAR(1),COL6 VARCHAR(1),COL7 VARCHAR(1),COL8 VARCHAR(10),USER VARCHAR(10));
INSERT INTO TEST_IP_FILTER VALUES ('00000000000000000000000', 'E', 'E', 'R', 'R', 'E', 'R', 'R', 'SD_000456', 'JACK');
INSERT INTO TEST_IP_FILTER VALUES ('00000000000000000000000', 'N', 'N', 'R', 'N', 'N', 'N', 'N', 'SFD_000486', 'HENRY');
INSERT INTO TEST_IP_FILTER VALUES ('00000000000000000000000', 'E', 'E', 'E', 'E', 'E', 'E', 'E', 'SFD_000489', 'PAUL');
Calculation View: