use same filters for 2 models based on same object (normal and aggregate)

  • 1
  • Question
  • Updated 3 years ago
Hello,

I'm looking for a way to be able to use filters on 2 models based on the same object

1 model is a normal one, the other is an aggregation

On the Screenshot below as example, I highlighted the aggregate fields

and i would like the filters on top of table to affect aggregate model as well





Thank you in advance
Photo of Dave

Dave

  • 5,538 Points 5k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Dave,

You could do something like this:
https://community.skuidify.com/skuid/topics/cross-model-linked-conditions


Alternatively, since you've only got two models, you could set your ag model with a condition Id in Id of any row from the basic model, and set an action on your basic model that whenever it's queried, query the ag model.
Photo of Dave

Dave

  • 5,538 Points 5k badge 2x thumb
Thank you Matt,

Excuse me , still a Skuid noob, the alternative you explained worked great.

the only issue is that that agg model has a grouping (used as a Filter based on a string field,filter is named: No Filter in SS below).)and it seems to affect the aggregations(basically duplicates all agg fields on page.

So instead of having 1 field per agg result , it multiplies it by the # of result in that string filter.

example below:

The grouping is based on Bank Name(highlighted). In this example i have 2 different groups that can be filtered on.
therefore you will see , two field editor now , each with result for it's own group

Anyway to prevent that?

I was thinking of cloning that agg model , but then it prob will create more issue, as the agg model is still used as filter

Or is it possible to create a aggregate model to aggregate the fields of 1st agg model?

Prob there is simpler solutions, i cannot foresee





Thx
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Dave,

The field editor will show once for each row in the model. I'm not sure I understand the scenario.  Why do you need a field editor to display the summary data when it's already there in the last row of the table? You could clone the Agg model and remove the grouping if that's really what you need.