How to apply a segment to a model

Hello all.

I've defined a segment in the hope of abstracting common filters so users can simply apply a named filter, aka a segment, to their data. However, I've managed to apply a segment to a table, but how do I do so for a model? Does the this "named filter" concept only apply to tables?

Thanks so much

After further investigation it appears that during the definition of a question, segments can only be applied against a table data source, not a model. These segment definitions appear at the top of the filter list with a prefixed star icon

When I attempt the same with a model, they're not present
Screenshot from 2023-03-13 11-45-20

Does that mean I have to define a sub-model, ie a model based on the same table, just to be able to apply segments?

In an attempt to retain all the aspects of a model, I was hoping that Duplicating the model would allow me to Edit Query Definition and then I could apply the Segments I've defined. But alas, duplicating a model removes all the Custom Column definitions from the resulting model :hot_face:

What's the point of touting features such as segmentation, calculated columns, models, etc as means of abstraction if they have such a narrow scope of application that they're borderline useless. Please tell me I'm missing something...

I'm battling to use Segments and Calculated Columns in Models. The rationale is to create predefined filters and columns on behalf of the user community and so shelter them from the technicality of these.

Secondly to make my workload lighter by abstracting these filters and column defs to such a degree that I only have to define them once, not per model. I can achieve this second objective for segments but not for calculated columns, even though both models are based on the same table. It appears that calculated columns has to be defined on the model level not the table level the models are based on? Hence, do I have to redundantly re-create each calculated column? Is that the only solution to my predicament?

You will need this feature to work Segments with models:

Regarding custom column with models ... The answer would be yes BUT you can create a Model against a table and then use subsequent questions against your Model ... So adding custom columns to the model will reflect in all questions using the Model as a datasource.

1 Like