Strange behavior with slice

Iโ€™ve got a slice
3X_2_e_2edeba1e79e6337d9a5cbc55c20fa8d9ccea157f.png
In my slice iโ€™ve got a row filter condition :

IN([Mod_ID],ANY(SELECT(Variable[Var_V_ACCESS_L],[Var_Mail_ID]=USEREMAIL(),true)))

Variable : is a table that for each user contains his own data, the key is USEREMAIL
Var_V_ACCESS_L : is a virtual column that contains the list of module the user can access

This slice display for each user the modules he can access

When i test this slice, it works well. iโ€™ve got this
3X_d_4_d43b029585b1decfaa3c0b33c2a8e7b76bd6444f.png

This is good , i can access to the 2 first module

But on the view using the same slice
3X_f_8_f87c9e06b8b67b8b6b96f34ed385909040151b15.png

Only 1 line is displayed !!!

3X_b_d_bd1ee2a182a45a2b12c4db6b98e0240d335e9c13.png

I should see the first 2 lines, exactly the same has the test done before directly on the slice

If i use the table in this view and not the slice
3X_6_2_620843c4ca6498be7fa7f62ac0ce23e3ea0b8a17.png

All the applications are displayed

3X_c_0_c08fb130f65f77c243e24547b7274ac58e35e2ef.png

Iโ€™ve checked in the documentation and slice can use virtual column in their condition
Do you know where i need to check ?

0 10 230
10 REPLIES 10

What if you remove the ANY?

Taking off the ANY
The result is bad in the test of the slide expression
3X_4_c_4c14f1aba32ff6cf4b1805ce12693b33f69b8ab9.png

But it is good in the view using the same slice !!
3X_4_3_434269e7f4e8ede1ff01680dc859a6fc86802adb.png

Congratulation
thank you
but for me this behevior is very strange
i would like to understand why?

Is the [Var_V_ACCESS_L] an EnumList?

yes it is an enum list

@Stephane_Liema This is a known challenge with the combination of Slice & IN() and EnumList() which is causing this weird behaviorโ€ฆ and thatโ€™s why itโ€™s not working correctly. We have a fix for this, but we havenโ€™t released it yetโ€ฆ and Iโ€™m afraid I donโ€™t have exact timeline for it.

never see the problem (not notifice before I mean) in terms of In and Enumlis combination.

I m not exactly sure what the nature of the problem is, but we do a trick to convert IN expression into CONTAINS expression by flating down the list type of data. We applied IN expressoin to filter out the records on the security filter and other place, but after flatting down (convert to contains expression) it massively improved performance as well.

Just as a quick thought to wonder.

@Takuya_Miyai

top
thanks

Steve
Platinum 4
Platinum 4

Instead of:

IN([Mod_ID],ANY(SELECT(Variable[Var_V_ACCESS_L],[Var_Mail_ID]=USEREMAIL(),true)))

Try:

ISNOTBLANK(
  FILTER(
    "Variable",
    AND(
      ([Var_Mail_ID] = USEREMAIL()),
      IN([_THISROW].[Mod_ID], [Var_V_ACCESS_L])
    )
  )
)

Or:

IN(
  [Mod_ID],
  SPLIT(
    CONCATENATE(
      SELECT(
        Variable[Var_V_ACCESS_L],
        ([Var_Mail_ID] = USEREMAIL())
      )
    ),
    " , "
  )
)

Theses 2 scripts are working good, in the slice preview and in the view using the slice the results are ok.

iโ€™m going to use :

IN( [Mod_ID], SPLIT( CONCATENATE( SELECT( Variable[Var_V_ACCESS_L], ([Var_Mail_ID] = USEREMAIL()) ) ), " , " ) )

  1. it is more easy to understand,

  2. i suppose it is faster for the AppsheetEngine because

the where clause for the select is only ([Var_Mail_ID] = USEREMAIL()), and Var_Mail_ID is a unique key

and CONCATENATE, SPLIT and IN are i suppose very few time consuming.

  1. I suppose also this :

SELECT(

Variable[Var_V_ACCESS_L],

([Var_Mail_ID] = USEREMAIL())

Is executed only once for all the table that i filter

For

FILTER(

โ€œVariableโ€,

AND(

([Var_Mail_ID] = USEREMAIL()),

IN([_THISROW].[Mod_ID], [Var_V_ACCESS_L])

)

)

The where condition of the filter as to be executed for each row of my table to slice, because it use [_THISROW].[Mod_ID] in the where condition, and this value change for each row

Do you know if there is a debug tool on appsheet to check the time consuming, for me to compare and to choose the best script ?

3X_1_2_125e175fb81a7c156c605f05a05d1a1beabb8447.png

Top Labels in this Space