Skip to main content

How can I set conditional filter in load script page? I have tried Case When, but it gives me error. Is there anyone who has suggestions?

Filter "xx"."yy" = <%= option1%> (it works)

 

 

i want to do multiple conditions like that in component filter

case when <%=option1> = 'a' than Filter "xx"."yy" = 'value' ;

case when <%=option1> = 'b' 'than Filter "xx"."yy" = 'value2' end

 

Is there any way to add conditional filter in the component filter section?

 

 

I made some test, but I couldn't get the results.

 

Nevertheless here my filter. Maybe it will give you some ideas

 

FILTER

CASE WHEN "CV_POLIZA"."COD_RAMO" = 111

THEN

CASE WHEN PU_COUNT(CONSTANT(),"CV_POLIZA"."NUM_POLIZA") > 1 THEN 1

ELSE 0

END

ELSE 0

END

>= 1

OR

CASE WHEN "CV_POLIZA"."COD_RAMO" = 110

THEN

CASE WHEN "CV_POLIZA"."NUM_POLIZA"= 'POL-04' THEN 1

ELSE 0

END

ELSE 0

END

>= 1

 


Maybe instead of using a component filter this could be achieved in the component itself using nested case when statements. Has that been tried yet?

yes , i have tried, but the problem is i am using dynamic filter, and it doesn't return the exact keyword in the table.


Can you try reordering it to something like this?

FILTER "xx"."yy" =
CASE WHEN <%=option1%> = 'a' THEN 'value'
WHEN <%=option1%> = 'b' THEN 'value2'
END
;
Can you try reordering it to something like this?

FILTER "xx"."yy" =
CASE WHEN <%=option1%> = 'a' THEN 'value'
WHEN <%=option1%> = 'b' THEN 'value2'
END
;

yes, it works properly. thank you


Can you try reordering it to something like this?

FILTER "xx"."yy" =
CASE WHEN <%=option1%> = 'a' THEN 'value'
WHEN <%=option1%> = 'b' THEN 'value2'
END
;

Hi @ALL

 

let me update my question.

one the dynamic filter should execute the null values in the table.

 

FILTER "table". "column" = CASE WHEN <%=option1%> = 'abc' THEN NULL END;

 

all other filters work but i cannot return null values from same table. I have have tried this formula 

FILTER "table". "column" = CASE WHEN <%=option1%> = 'abc' THEN Filter_TO_NULL("table". "column") END;

 

but when i have tested, i saw that i didn't bring up all null values from table. Does anyone have an idea?

 


Reply