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)

3X_6_a_6afee53a9d750e8abd84fc230b85b9e4ed17f841.jpeg

Solved Solved
0 4 252
1 ACCEPTED SOLUTION

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

View solution in original post

4 REPLIES 4

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!!

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

3X_f_6_f61904e32afb7f5f617caea7121df6861a329a0e.jpeg

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

Perfect, thank you so much

Top Labels in this Space