Help with slices

I have a table called Jobs.
Job No - Key
Date Created
Status
Site - Ref to Active Sites Slice
etc.

Table Sites
Site Name - Key
Active Yes/No
etc.

Active Sites Slice
Row Filter - [Active]=TRUE

So this works for when I add a new job, only the Active Sites will show in the dropdown list.

I have a slice called All Jobs based on Jobs table and a View called All Jobs grouped by Site.
I can’t work out how I can only show the Active Sites here. Help much appreciated.
Inactive Sites show as below (Union St)

Active Sites

To paraphrase - you want to see only Jobs where the Site has Active = TRUE. Correct?

If so, then you will want to add a Jobs Slice where the row filer = ‘[Site].[Active] = TRUE’. Use this Jobs Slice in your “All Jobs” view.

Now for the [Site] column in your Jobs table, you will want to conditionally assign the list of values.

When adding a new Job, only show the Active Sites based on your Active Sites slice. BUT, when simply viewing Jobs in any other view, the [Site] column should retain ALL Sites. Some Jobs will have inactive Sites that were inactivated after the Job was added. If you view that Job row and only have the active Sites in the list, then that inactive Site is considered an “invalid” value for the [Site] column and will appear with the yellow caution symbol.

SO…the expression for your Sites column should be (drum roll)…

IF (CONTEXT("ViewType") = "Form",  
     Active Sites[Site Name], 
     Sites[Site Name]
)

I hope this helps!!

2 Likes

Thanks so much for your help @WillowMobileSystems .
This worked perfect [Site].[Active] = TRUE
But I got this message for the [Site] expression in Jobs table

Sites

Ah! The expression needs to be placed into the Valid_If property of the Site column.

2 Likes

Perfect, thank you so much :grinning: :grinning:

1 Like