How to filter table rows with multiple values for the same column?

Find and share HowTos to various installations / configurations!
7 posts • Page 1 of 1
adaneau
Posts:310
Joined: Tue Feb 21, 2012 9:49 am

How to filter table rows with multiple values for the same column?

Post by adaneau »

Hi,

I am a bit confused by the implementation of the table in WinCC OA. I want to filters the rows of my table, displaying only rows matching pattern "AAA" or "BBB" but hide the rest.

I use the function filterRows from table object but it seems to not read regex properly. I tried few standards : ANSI-92 and regex from Linux man, as well as syntax from QTableView object filter from Qt.

- Using "AAA|BBB" as filter pattern doesnt work
- Using "{AAA,BBB}" as filter pattern doesnt work
- Using "^(AAA|BBB)" as filter pattern doesnt work

So now I am a bit out of ideas. Did someone already achieved such a thing?

Thanks in advance.

Best regards
Alexandre

amichon
Posts:93
Joined: Sat May 17, 2014 3:49 pm

Re: How to filter table rows with multiple values for the same column?

Post by amichon »

Hi Alex,

I use filterRows by coupling it with a search field containing a single word. It uses internally dynPatternMatch or similar function.

If you need to filter a query result or any data you must to implement you own filter with regexpIndex() function.

Have a nice summer ;)

Aurélien

adaneau
Posts:310
Joined: Tue Feb 21, 2012 9:49 am

Re: How to filter table rows with multiple values for the same column?

Post by adaneau »

Hey Aurelien,

Thanks for reply.
I dont want to redo the query, too heavy, just to hide some rows on table based on multiple conditions in one column.

Let we imagine that I have a column called name : this column contains values like "Alex" or "Aurelien" or "Leo".

I want to display only row having value "Alex" or "Aurelien" but I have no idea how. I can dispay rows with "Alex" or rows with "Aurelien" but not both, it is exclusive choice.

Considering that Qt normally allows this by allowing regex filtering on rows, I was wondering why it is not working in WinCC OA 3.18? Maybe different syntax is expected ? (see my initial post with my attempts).

Looking forward to get help on this.

Best regards
Alex

amichon
Posts:93
Joined: Sat May 17, 2014 3:49 pm

Re: How to filter table rows with multiple values for the same column?

Post by amichon »

Maybe the WinCC OA Team could make an improvement with regexp! I need it too

emaddocks
Posts:83
Joined: Tue Sep 04, 2018 12:50 am

Re: How to filter table rows with multiple values for the same column?

Post by emaddocks »

This is a much needed addition to Tables.

Tables are a great way to display data, sort data, select data...but definitely not to filter data :(

OA Team please add the functionality to apply multiple filters on a single column!


There is a way to apply multiple filters but it's not easy to implement. For example, to filter on "Alex" or "Fred" you can use the filter "[AF][lr][e][xd]". This gets even more complicated if you have different length words / sentances to filter on.

Even with this trick it's still not possible to use the Tables filter to achieve what we need so we've had to filter the data before adding it to the table :(

gschijndel
Posts:376
Joined: Tue Jan 15, 2019 3:12 pm

Re: How to filter table rows with multiple values for the same column?

Post by gschijndel »

I agree filtering the table rows should be improved. In my case I had some checkboxes to hide some table rows, but since there is no option to hide a specific row I had to add a additional column for 'filterRows' to show the selected rows.

I guess it could also work for Alex.
1. Reset the additional column with 'lineParam' from TRUE to FALSE
2. For each value to should be shown set the additional column to TRUE (also with lineParam)
3. Use 'filterRows' to hide the other rows

adaneau
Posts:310
Joined: Tue Feb 21, 2012 9:49 am

Re: How to filter table rows with multiple values for the same column?

Post by adaneau »

Hey,

Happy new year and thanks for the reply.

Actually I like the idea of hidden column and blame myself to not thought about it. Basically have a hidden column "visible TRUE/FALSE" and use a table loop function to fill it according to search pattern.

Will definitely try this.

Thanks!

7 posts • Page 1 of 1