When I use Max(Table[Date]), It returns the m...

When I use Max(Table[Date]), It returns the most recent date correctlyโ€ฆ

but I want to pull the date for a project associated with a specific employee with (Maxrow(table, date, useremail() = employee email) + a ref column - as shown in the given appsheet example code.

When I use Maxrow(Table, Date) It says it cannot be parsed due to #VALUE!. What does this mean and how can I fix it?

0 14 2,649
14 REPLIES 14

tony1
New Member

@Johann_Harshman Can you try MAXROW(โ€œYour Table Nameโ€, โ€œYour Date columnโ€)

Iโ€™m trying to do a similar thing, I have MAX(SELECT(Hires[Date], โ€œBorrowerโ€ = โ€œFull Nameโ€)) but, although it all looks correct, it just doesnโ€™t return a date where it should. All my table/column names are correct, help?

Hi,

Could you please check what the sub-expression โ€œBorrowerโ€ = โ€œFull Nameโ€ consisting of? Both seem to be text values. The select statementโ€™s second argument typically needs to be either row based, thus having a column name denoted by [Column Name] in the argument or simply consisting of a TRUE or FALSE condition.

You may wish to take a look at following document on SELECT() statement construction https://help.appsheet.com/en/articles/2357314-select

Ok, so if I want to return a result where the โ€œborrowerโ€ column matches the โ€œFull nameโ€ column in the table Iโ€™m working in, how would I structure that?

Thanks for the update. Do both the columns have same information type and column types and are those in the same table?

For example if [Full Name] consists of โ€œJohn Doeโ€ in a particular row, then the SELECT() will return the [Date] for that row, only if [Borrower] also consists โ€œJohn Doeโ€ in the same row.

The MAX statement including SELECT() statement in such a case will be something like
MAX(SELECT(Hires[Date], [Borrower] = [Full Name]))

So Full name is text, but Borrower is ref. Full name is in the table where I want to populate the Last active date, and Borrower is in the table where I want the date date retrieved from. I can provide screenshots if that would help clarify things?

Yes, I believe you may wish to mention some more details such as whether the two tables are referenced to each other and which is the parent table among the two and what are the relevant columns in each table related to the expression.

You did mention borrower is a ref. Is it a reference column in the table containing full name. If borrower is reference column (then it is a key of borrower table) , then is there another column in the borrower table ( Say Borrower Name or is Borrower name itself key) to match the Full Name in the other table.

In this regard, in general, since you have mentioned reference and two related tables, I request you to take a look at following articles, just in case you have not before. If you are using related tables, then these articles are very useful.

Thanks, Iโ€™m completely lost and I donโ€™t entirely understand how appsheet has connected things together, so I guess Iโ€™ve got more reading to do on those links

Ok, so the two tables are referenced to each other. Iโ€™m not sure which one is the parent table. โ€œFull Nameโ€ is the key for the โ€œMembership Databaseโ€ table, and I think โ€œBorrowerโ€ in the โ€œHiresโ€ table is referenced to that, but the key in the โ€œhiresโ€ table is just the row number because each borrower can have multiple records against their name. Which gets to what I want the expression to do - pull the date of the most recent record. Hope this makes things slightly clearer

Hi @leahcarn,
Thank you.The detailssurely help to some extent. I will still make some assumptions and request you to evaluate as follows. It sounds that โ€œMembership Databaseโ€ is your parent table , because each โ€œFull Nameโ€ in that table could have multiple borrowings in the โ€œHiresโ€ table. Also as you have mentioned the two tables are referenced.

Presuming Hires is the child table, you will have a virtual column called something like โ€œRelated Hiresโ€ in your โ€œMembership Databaseโ€ table.
If this is the case , you may have a Virtual column in the โ€œMembership Databaseโ€ with an expression like MAX([Related Hires][Date])

If you still have challenge in terms of results from this expression, you may wish to post a picture of just the column with type โ€œRefโ€ from Data - > table - > Column pane in AppSheet editor of the relevant table. ( Please mention the name of the table) and picture of settings pane of that Ref column. This will help community members in knowing exactly which table is referenced to what.

On a side note, you may wish to reconsider having Row_Number as a key as it is an implicit key. Please refer to the article

ARGH!!!
The tables are set up exactly as you described. I used the expression you suggested, and in testing, it looks great. When I go through and save it, it returns โ€œInvalid Dateโ€.
Where to from here?!
2X_5_5f2ac21e140825dd90a5091f7d1bfe24f4197bbf.png
2X_d_da480ed476eb46c73f5370f78e9b5668241be18e.png

Thank you for the updates. Very good to know the tables were set up as described and there is progress. I presume the LastActiveDate column is in โ€œMembership Databaseโ€. Could you confirm the said column is of Date Type and could you please share a picture of settings pane of that column?

Also could you please mention if the date column is set up exactly in the same manner in both the tables?

You may also search the earlier posts in the community on "invalid dateโ€™issue faced before. You may wish to look at the following post. Request you to regenerate the table after making any change to a column, if not already done.

Thanks
I had a read of some of the other โ€œInvalid Dateโ€ Threads, reformatted that column to a date column in the original table, and now itโ€™s working. MM/DD/YYYY, but I can live with that if I have to.
Thanks again for all your help

Thank you for the update. Good to know the desired functionality works. All the best.

Top Labels in this Space