Slice Data Based on Field Contains

Hi Everyone,

I am currently building a workforce management app where the user submits a placement, start date, end date, and set days. A series of actions then create a row form each day in between and also add what day name that date is.

I am trying to create a slice that only shows the row where the Set Days contains the same value as the new day name value. This will then remove any dates where the placement is not one of the individualโ€™s set days.

I would really appreciate help with the expression, I have tried IF statement but this makes only the first row as Y, so if the set day is Thursday, Friday, it will only bring in Thursday as the first value;

ifs(CONTAINS([Set Days],โ€œMondayโ€),[Day]=โ€œMondayโ€,

CONTAINS([Set Days],โ€œTuesdayโ€),[Day]=โ€œTuesdayโ€,

CONTAINS([Set Days],โ€œWednesdayโ€),[Day]=โ€œWednesdayโ€,

CONTAINS([Set Days],โ€œThursdayโ€),[Day]=โ€œThursdayโ€,

CONTAINS([Set Days],โ€œFridayโ€),[Day]=โ€œFridayโ€)

Any help would be greatly appreciated,

Thank you

Solved Solved
0 11 207
1 ACCEPTED SOLUTION

Change to EnumList of base type Text with values of the allowable weekday names:

3X_1_0_10b6c99a00840508eaad065d361ae9f8508525a6.png

View solution in original post

11 REPLIES 11

Steve
Platinum 4
Platinum 4

Maybe this?

IN([Day], [Set Days])

Thanks, Steve for getting back to me,

I have found all of your posts on the community very helpful,

When using,

IN([Day], [Set Days])

I am getting the following error

Parameter 2 of function IN is of the wrong type

Is there anything else I need to do?

What is the column type of the Set Days column? That itโ€™s plural suggests it may contain several days.

Apologies yes it is a text enum list that users can select multiple days, the output is therefore โ€˜Monday, Tuesdayโ€™

Please post a screenshot of the tableโ€™s column list from Data >> Columns in the app editor, including at least the Day and Set Days columns.

Please also post a screenshot of the slice configuration.

Thanks Steve,

Below is my table configuration;

Again thanks for your help,

Best Wishes
James

Change to EnumList of base type Text with values of the allowable weekday names:

3X_1_0_10b6c99a00840508eaad065d361ae9f8508525a6.png

That has done the trick thanks for your help Steve!

I was wondering, no problem if not, how do I go about adding something like the following into the IN statement;

WEEKNUM([Date]) = WEEKNUM(TODAY())

Thanks again

Perfect thank you for all your help

For my slice, I have had to compromise to create a separate slice for each day, but itโ€™s not ideal as it means creating 5 tables,

Top Labels in this Space