Jump to content

Why is Data Function triggered even if input table/column is unchanged by filtration


Przemek Stasica

Recommended Posts

I'm triggering a data function based on filtration of a data table (to capture filter change event) but the function is triggered even if the number of filtered rows does not change.

What might be going on

 

Table A (EAV style)

Ent | Attr | Value

01 | Attr1 | 1

01 | Attr1 | 2

01 | Attr1 | 5

02 | Attr1 | 1

02 | Attr1 | 4

My objective is to capture filtration change which only changes the number of unique entities in the remaining rows but ignores elimination of rows within the entity group.

To do that I made a pivoted Table B based on Table A which only lists the entity IDs:

Ent |

01 |

02 |

Table A and B have relation on "Ent" and the filtering scheme tells Table B to exclude filtered rows from Table A.

In that way when I filter by Value the Table B is not changing - it always list all entities (unless I happen to remove all the rows for a given entity in Tab A).

When I filter Tab A by Entity the Tab B then changes in synch.

I have a data function set up to take Tab B and react to its filtration.

 

In that way I hoped to capture only the entity filtration change. However, this set up seems to be reacting to any filtration change even when the input Tab B did not change at all. The data function is triggered regardless, even if one row is filtered off from TabA and Tab is completely unchanged.

 

What am I missing

Any other way to achieve my goal

Cheers!

Link to comment
Share on other sites

I think, since Tab A and Tab B are connected by your filter, Tab B is refreshed anytime when you change the filter for Tab A. You might not see a difference, but I'm pretty sure that Tab B is getting refreshed. And since Tab B is input for your data function, the function will be triggered. 

 

Maybe you could use a simple TERR function to store the UniqueConcatenate([Ent]) to a document property. The input 'X' to the TERR function would be the filtered column [Ent], store 'out' to a doc property

 

out <- paste(sort(unique(X)), collapse = ", ")

 

And then trigger an ironpython script on the change of the doc property to run your data function. But I'm not sure if a a simple refresh (with same result) of the doc property is also considered as a "change". Then you would run into the same trouble again. Please give it a try.

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...