Maxrow help

Hi everyone,

I have two tables Parent "TECNICO" and child "MOVIMIENTOS 2". I want to record in a virtual column in TECNICO's table the latest date when an operator recived Personal Protective Equipment (PPE).

I used this formula, where the validation box says it's correct, but it returns a null value:

EOMONTH(
 LOOKUP
  (MAXROW(โ€œMOVIMIENTOS 2โ€,โ€œFECHA_MOVIMIENTOโ€,and([NOMBRES]=[_THISROW].[NOMBRE],[TIPO]="GUANTE OPERADOR")),"MOVIMIENTOS 2",ID_MOVIMIENTO,"FECHA_MOVIMIENTO"),ANY(SELECT(TIPO[TIEMPO], ([ID TIPO]="GUANTE OPERADOR"))) - 1)
+
DAY(
 LOOKUP(
   MAXROW(โ€œMOVIMIENTOS 2โ€,โ€œFECHA_MOVIMIENTOโ€,and([NOMBRES]=[_THISROW].[NOMBRE],[TIPO]="GUANTE OPERADOR")),
  "MOVIMIENTOS 2",ID_MOVIMIENTO,"FECHA_MOVIMIENTO"))

 I split the formula into the different expressions it contains to see wich one failed, wich led me to realiza the MAXROW formula is returnig the null value, leading the rest of the formula to retun an empty date value (31/1/2001).

MAXROW(โ€œMOVIMIENTOS 2โ€,โ€œFECHA_MOVIMIENTOโ€,AND([NOMBRES]=[_THISROW].[NOMBRE],[TIPO]="GUANTE OPERADOR"))

I dont undestand what's worng with the formula, it just returnas an empty value in the test window:

G0ldsoul_0-1686078151254.png

For reference here are the tables and columns used in the expresions.

TECNICO

G0ldsoul_2-1686078219046.png

MOVIMIENTOS 2

G0ldsoul_3-1686078297948.png

G0ldsoul_5-1686078376573.png

The [NOMBRES] column is a deference from another parent table to MOVIMIENTOS 2, "VALE DE ALMACEN" where it calls the [NOMBRE] value from table TECNICO.

G0ldsoul_6-1686078596472.png

Thanks in advance community!

 

Solved Solved
0 3 161
1 ACCEPTED SOLUTION

following expression:

 

MAX(
SELECT(
MOVIMIENTOS 2[Fecha],
AND(
ISNOTBLANK([PPE]),
[TECNICO ID] = [_THISROW].[TECNICO ID]
)
)
)

 

You can use this expression in the virtual column formula of the "TECNICO" table to display the latest date when an operator received PPE.

 

IF(
ISBLANK(
MAX(
SELECT(
MOVIMIENTOS 2[Fecha],
AND(
ISNOTBLANK([PPE]),
[TECNICO ID] = [_THISROW].[TECNICO ID]
)
)
)
),
"",
MAX(
SELECT(
MOVIMIENTOS 2[Fecha],
AND(
ISNOTBLANK([PPE]),
[TECNICO ID] = [_THISROW].[TECNICO ID]
)
)
)
)

 

 

View solution in original post

3 REPLIES 3

Um in eine virtuellen Spalte in der Tabelle von TECNICO das spรคteste Datum einzutragen, sieht meiner Ansicht nach Ihr Ausdruckteil 

LOOKUP(
   MAXROW("MOVIMIENTOS 2","FECHA_MOVIMIENTO",and([NOMBRES]=[_THISROW].[NOMBRE],[TIPO]="GUANTE OPERADOR"))

richtig aus. (nicht getestet)

 

Yes, itยดs correct in theory. But the result's still null.

G0ldsoul_0-1686091144998.png

 

following expression:

 

MAX(
SELECT(
MOVIMIENTOS 2[Fecha],
AND(
ISNOTBLANK([PPE]),
[TECNICO ID] = [_THISROW].[TECNICO ID]
)
)
)

 

You can use this expression in the virtual column formula of the "TECNICO" table to display the latest date when an operator received PPE.

 

IF(
ISBLANK(
MAX(
SELECT(
MOVIMIENTOS 2[Fecha],
AND(
ISNOTBLANK([PPE]),
[TECNICO ID] = [_THISROW].[TECNICO ID]
)
)
)
),
"",
MAX(
SELECT(
MOVIMIENTOS 2[Fecha],
AND(
ISNOTBLANK([PPE]),
[TECNICO ID] = [_THISROW].[TECNICO ID]
)
)
)
)

 

 

Top Labels in this Space