Skip to main content

Hello! Among my data I have records with four possible values in the column Class ('Inactive', 'Proc Manage', 'non-Proc Manage' and '-'). The last option occurs when there is no value for the record inside Class column.

 

Annotation 2024-02-15 201338 

Although without filtering I can see records with all values of Class listed above, trying to filter as in the picture, I can't get them (I receive only Inactive ones, my goal is to get empty ones also). If I want to get for example only those where Class = 'Inactive', it's easy, but what about the requirement to filter only records with no value for Class column? I don't know how to do it in a table, and inside Action Flows filtering as well. My intuitive code inside Action Flow is

 

FILTER "MyTable"."CLASS" IS NULL

 

, but unfortunately, there is no result. Do you have any idea how to solve this issue? I will be grateful for your support.

Hi @rafal.augus,

 

Inverting the selection is indeed not the same as selecting the empty ones, for the same reason you use 'IS NULL' and not '= NULL' (see https://stackoverflow.com/a/2749070/6901541 for a description about this).

Now the solution. The easiest way is to populate all values in your "Class" column, so that you can work with the filters normally.

 

I would suggest the following syntax that replaces the Class column:

CASE

WHEN "MyTable"."CLASS" IS NOT NULL

THEN  "MyTable"."CLASS"

ELSE 'Not Defined'

END

 

You can rename 'Not Defined' of course to whatever you like. Now you are able to run normal filters.

 

PS. Your filter on the action flow seems legit, for this to understand why it is going wrong I need more context.


Hi @rafal.augus,

 

Inverting the selection is indeed not the same as selecting the empty ones, for the same reason you use 'IS NULL' and not '= NULL' (see https://stackoverflow.com/a/2749070/6901541 for a description about this).

Now the solution. The easiest way is to populate all values in your "Class" column, so that you can work with the filters normally.

 

I would suggest the following syntax that replaces the Class column:

CASE

WHEN "MyTable"."CLASS" IS NOT NULL

THEN  "MyTable"."CLASS"

ELSE 'Not Defined'

END

 

You can rename 'Not Defined' of course to whatever you like. Now you are able to run normal filters.

 

PS. Your filter on the action flow seems legit, for this to understand why it is going wrong I need more context.

Hi @janpeter.van.d , thank you for the response. The solution for a table doesn't work, but I would like to focus on the issue with the action flow.

 

My intention is to collect only records, where Class value is empty or Class equals 'Inactive'.

Thus I tried with the filter inside query data module:

 

FILTER "MyTable"."CLASS" IS NULL OR MyTable"."CLASS"='Inactive'

 

... and it didn't work (it collects ONLY the records where Class equals 'Inactive'). I don't know why. The workaround which I found is to not using this filter inside query data module, but to build filter on the connection between this module and the next one in the action flow, as on the picture below:

Annotation 2024-02-21 110636... and it works! However, this is not an optimal solution because without filtering inside the Query Data module, I'm collecting much more records than I would like to collect (it significantly impacts Action Flow performance). Do you think it's possible to solve it without the workaround I presented?


Hi @rafal.augus How about excluding the values which you don't need by applying

 

FILTER "MyTable"."CLASS" NOT IN ('non-Proc Manage', 'Proc Manage');

 

This should work both in component filter and in AF filter

 


Hi @rafal.augus How about excluding the values which you don't need by applying

 

FILTER "MyTable"."CLASS" NOT IN ('non-Proc Manage', 'Proc Manage');

 

This should work both in component filter and in AF filter

 

Hi @bunyod.sap , thank you, but unfortunately, the result of such approach is getting only 'Inactive' ones, empty ones are omitted


Hi @janpeter.van.d , thank you for the response. The solution for a table doesn't work, but I would like to focus on the issue with the action flow.

 

My intention is to collect only records, where Class value is empty or Class equals 'Inactive'.

Thus I tried with the filter inside query data module:

 

FILTER "MyTable"."CLASS" IS NULL OR MyTable"."CLASS"='Inactive'

 

... and it didn't work (it collects ONLY the records where Class equals 'Inactive'). I don't know why. The workaround which I found is to not using this filter inside query data module, but to build filter on the connection between this module and the next one in the action flow, as on the picture below:

Annotation 2024-02-21 110636... and it works! However, this is not an optimal solution because without filtering inside the Query Data module, I'm collecting much more records than I would like to collect (it significantly impacts Action Flow performance). Do you think it's possible to solve it without the workaround I presented?

Hi @rafal.augus,

 

I've never seen this behavior before, so to be honest I'm clueless...

Generally speaking, I would say that if the PQL doesn't work in an OLAP table as presented above, the Filter statement won't work ether.

The last things I could think of:

  • Instead of NULL you could try to test if it is an empty string (using two single brackets, i.e. column <> '')
  • The column of the record is based on a value of another table by adjusting the PQL in the Knowledgde Model. The value is than not null but the value just doesn't exists. In this case you could create the filter on the source table, but since this situation is quite rare, I don't think this is your case.

Hi @bunyod.sap , thank you, but unfortunately, the result of such approach is getting only 'Inactive' ones, empty ones are omitted

I think it has to do with Vertica logic and the IS NULL must be extra specified. I would try it in following way:

 

FILTER "MyTable"."CLASS" NOT IN ('non-Proc Manage', 'Proc Manage') OR "MyTable"."CLASS" IS NULL;


Reply