how to transform a nested list into a flat list

in a table I have a start date column which is called [From] of type Date and another end date column which is called [To] of type Date, in the same table I have a column virtual which contains the list of all the dates between [To] and [From] which is called [ExtraitDate], I want to create a list of dates from the column [ExtraitDate] to use it in the WORKDAY() function , but with this formula WORKDAY(MAX(Select(Register of RDS booklets[Date_Derniere_Feuille],([Unite]=[_THISROW].[Unite]))), 21, ListePedago[ExtraitDate]) I have this error, WORKDAY has invalid inputs. Parameter ListePedago[ExtraitDate] has the wrong element type: List

SPLIT((β€œβ€ & (ListePedago[ExtraitDate] - LIST(DATE(β€œβ€)))), " , ")

1 Like

I have this error message, Arithmetic expression β€˜(ListePedago[ExtraitDate]-LIST(DATE(β€œβ€)))’ cannot convert β€˜List of Date’ to β€˜List of List of Date’

1 Like

Whoops! Try this instead:

SPLIT((β€œβ€ & (ListePedago[ExtraitDate] - LIST(β€œβ€))), " , ")

Arithmetic expression β€˜(ListePedago[ExtraitDate]-LIST(β€œβ€))’ cannot convert β€˜List of Text’ to β€˜List of List of Date’

1 Like

OK. How about just this?

SPLIT((β€œβ€ & ListePedago[ExtraitDate]), " , ")

WORKDAY(MAX(Select(Registre des livrets RDS[Date_Derniere_Feuille],([Unite]=[_THISROW].[Unite]))), 21, SPLIT((β€œβ€ & ListePedago[ExtraitDate]), " , "))

error : WORKDAY has invalid inputs. Parameter SPLIT(CONCATENATE(β€œβ€,ListePedago[ExtraitDate])," , ") has the wrong element type: Text

Wow! OK, so let’s try this, then:

(LIST(DATE(β€œβ€)) + SPLIT((β€œβ€ & ListePedago[ExtraitDate]), " , β€œ) - LIST(DATE(”")))

I created a new virtual column with this code, UNIQUE(SPLIT((β€œβ€ & ListePedago[ExtraitDate]), " , ")) and I inserted the column in the code, WORKDAY(MAX(Select(Registre des livrets RDS[Date_Derniere_Feuille],([Unite]=[_THISROW].[Unite]))), 21,[ListDatePed])

and everything works perfectly, thank you

1 Like