Select function with between value

Hello! I have a table with the fields below. I need to enter a salary value in the app and, through a SELECT ( ) function, search for the PER_ALIQUOTA field in which the salary is between the MINIMUM_VAL and MAXIMUMVAL_VAL fields.

I'm using the formula below, but it doesn't return the desired value:

SELECT(TBRL_BASE_CALCULO_INSS[PER_ALIQUOTA], AND([_THIS].[VAL_SALARIO_BRUTO]>=[VAL_MINIMO], [_THIS].[VAL_SALARIO_BRUTO]<=[VAL_MAXIMO]))

Pedro_Paulo_San_1-1697024618837.png

0 3 109
3 REPLIES 3

Instead of using [_THIS], try with [_THISROW].

@AleksiAlki , thank you for your answer, but I changed _THIS to _THISROW and the problem continue.

Pedro_Paulo_San_0-1697032021372.png

 

It sounds the problem is not with the formula.. the logic is just a little bit wrong. You need to check also if the salary is less than the minimum. And set the salary column to mandatory so you don't need to figure out what happens if its a blank. You are also probably looking for one value, not multiple. Then add ANY(SELECT(...))

Top Labels in this Space