Use two different views for the same table


I am trying to explain a situation I need to solve. Hope my explanation is clear.

I have a table of activities that is related (REF) with two other tables: Team (each activity is leaded by one team and each team leads n activities) and Objective (each activity is related to an objective it helps to develop and each objective has many related activities). Each Objective is assigned to a team that leads its development.

The schema is as follows


I need two different ways to view Activities:

  • If I come to activities from the view of a Team, I need to see them grouped by Objective
  • If I come from the view of an Objective, I want to see activities grouped by Team

Cannot figure out how to deal with this problem. Hope someone has a clue to solve it.

Thanks in advance.

Have you connected these tables using references?

If so, then inside the Teams table you should have:

  • Related Activities
  • Related Objectives

Also, inside Objectives, you should have:

  • Related Activities

If so, then you’ve got inline views for these - I assume is what you mean by:

I see what you’re talking about: both would share the same inline view.

  • Related Activities

You want to know how you can have one inline view for one view, and another for another.

The answer is… complicated, but doable. :nerd_face:

Perhaps there’s a way to use CONTEXT() here, but what I’ve done in the past is:

  • Create a slice of the table I want another view for
  • Make my view for the slice
  • Create an additional column in my parent table, using a variant of the Ref_Rows(“Table”, “Ref_Column”) that’s already there. Instead of pulling records from the original “Table”, instead switch that to the slice you just made: Ref_Rows(“Slice”, “Ref_Column”)
  • Specify which column to show in your parent detail views.

This creates another inline view (just like the one that’s already there) but the data comes from the slice (which has it’s own view) - thus giving you the ability to change how records are shown in one view from the other.

Complicated, yeah… maybe a bit messy. I’m wondering if you might be able to use CONTEXT() to determine which inline view would be used for child records on a parent detail view… I’ll experiment and report back.

******UPDATE - I tried creating a duplicate inline view and using CONTEXT(“View”) <> “ViewName” to exclude one and show the other… failure.

Did not work. But honestly, that would be asking a lot of the system - to evaluate not only if the column should be shown, but also which view to use?


Great!! It works fine!
Maybe a little tricky but fully functional

Thank you very much.