I need to get last value returned from a filter function

i have a formula like that
filter(lookup('Table A','CreatedDate'),totext(lookup('Table A','Approved')) = 'yes')

which returns an array of dates I want to get the last date of them ?

Hi,

I you are sure that dates will always have a length of 10 characters (MM/DD/YYYY or DD-MM-YYYY) you can combine the join() and right() function.

  • join() converts the array to a single string
  • right() picks the amount of characters specified in the second argument. In this case 10

The final function would be
right(join(filter(lookup('Table A','CreatedDate'),totext(lookup('Table A','Approved')) = 'yes')),10)

Regards
Frederik

thanks for your reply but it shows

Error with formula: 1 argument was given to the function join, it must instead be given exactly 2 arguments

My mistake, I did copy/pasted the formula correct. This should work:

right(join(filter(lookup('Table A','CreatedDate'),totext(lookup('Table A','Approved')) = 'yes'),' '),10)

The part I inserted between the parentheses of 'yes')) is the second parameter of the join() function and indicates which character is used between the values. In this case, it is a space.