EnumList: Filter values based on another EnumList

Hello,

I wonder if it is possible to filter a EnumList dropdown based on another Enumlist dropdown.

Objective:
I’m working on a App for hotels and we want to select a collection of Hotels
Dropdown 1: Hotel Categories
Dropdown 2: Hotels

Hotel Categories is a EnumList which describes if the hotel is a 4* , 5* hotel, etc.
The user can select one or many options here.

Hotel Categories should filter Hotels EnumList dropdpwn

Example:
I tried the following in order to get the list of Hotels that have any of the selected Categories.

Hotel Categories: {4 *, 5 *}
Hotel:

SELECT(Hotel[hotelName],
(IN(Hotel[hotelCateogoria], [_THIS].[hotelCateogoria]))
,TRUE)

The problem:

The above script works when the values in the field hotelCategorie has 2 or more items selected.
However, if I only select one hotel Category, it returns nothing.

Thanks for any suggestion.

UPDATE

I’m guessing the problem is related to the fact that if Hotel Categories only has 1 value, the second parameter of the IN() function is no longer a List.

If that is the case I’m attempting this approach, with no luck yet

SELECT(Hotel[hotelName],
(IN(Hotel[hotelCateogoria], 
IF(COUNT(SPLIT([_THIS].[hotelCateogoria], ","))  = 1, LIST([_THIS].[hotelCateogoria]), [_THIS].[hotelCateogoria] )))
,TRUE)
Solved Solved
0 9 584
1 ACCEPTED SOLUTION

Hi

I requested to try

Could you please update any specific reason you are adding Hotel before [hotelCateogoria] as highlighted below?

View solution in original post

9 REPLIES 9
Top Labels in this Space