Expression result not same

Hi All,
I have used this:"Filter(Sales Summary,[Timestamp]=MAX(Sales Summary[Timestamp])) " in my reference rows from my action. it is working as expected.

I have copied the same expression in a similar app and it is strangely returning list instead of one Max Value.
I looked at the g sheet and manually inputted a spreadsheet formula to determine the Max Value. so I am sure the expression should give me the max but instead, it gives me a list.

what I am missing here?

thanks.

0 17 431
17 REPLIES 17

Could you please share what is the type of [TimeStamp] column? DateTime or Date type

Also could you test what the expression following expression returns in the test pane in the first appโ€™s table and second b appโ€™s table and share the screenshot if possible

SalesSummary[TimeStamp]

it is DateTime.
app A


app B

Can you please instead try

MAXROW(โ€œSalesSummaryโ€, โ€œTimestampโ€)

its returns:
The expression is valid but its result type โ€˜Refโ€™ is not one of the expected types: List

as you see in the image, seems the appsheet is reading the value as all similar that is why returning list instead of single value. strange.

You may wish to change the column type to โ€œrefโ€ if you are trying to find the key to the row with the highest timestamp.

Are you trying to search the row with the highest key with the filter expression? And could you please update where you are using the expression.

I am using it in the action ref rows. it all works well in the first app.
i have the same setting both in app A and app B.
not sure which one i need to change to ref . also why i need to change when it works in the first and not the other? maybe a bug?

Could you share the screenprint of the action where you are using the expression?

here it is. thanks

Please try with in the action of the app where you are expecting a single row and getting multiple rows returned with earlier expression.

[Key Column]=MAXROW(โ€œSalesSummaryโ€, โ€œTimeStampโ€)

in place of filter expression. Please replace with key column name on the left hand side.
Edit: or simply
MAXROW(โ€œSalesSummaryโ€, โ€œTimeStampโ€)

Hi ,
Why when I test it using Sales Summary[Timestamp] in app B, the [Timestamp] Returns these:

it became all same value

Hi Suvrutt,
really glad for your assistance but I have tried those and it wont allow me to put that Maxrow expression as it is throwing an error.
moreover it will complicate a lot in my app if i change the setting, at least to my mind.

Can we just analyze rather why the result is giving all same datetime values even the gsheet stored all unique datetime values. the filter expression is giving multiple result due to gsheet is giving all same strange values or appsheet is extracting that is not present in the gsheet.
please see image;

Hi @reggieneo

Thank you for sharing elaborate details. Yes , that was one reason I requested you to try with SalesSummary[TimeStamp] to know if for some reason it is returning multiple same date timestamp and then we exchanged a few messages. My bad I somehow missed those identical date-times in an image.

Based on the latest timestamp results you shared, I believe, yes, there is some column format issue either in the backend sheet or column in the app of the timestamp column. Not able to zero on it at the moment with my testing. I will revert if I can think of some working solution.

Hope the column is formatted as datetime both in the app and backend Google sheet. It may be a good check to do. Also Locales of the sheet and the app editor are same.

Minor edit: replaced inadvertently used word, email with the correct word message in the description above.

You may want to add if the timestamp values stored through the app in the G sheet or is the app connected to the already populated G sheet that had datetime stamps.

I copied the timestamp column from app A and, add another temp column to app B and pasted the timestamp there, named it timestamp2 then temp remove and replace the original timestamp column by the one form App A to make sure I got the right format. tested it and it worked. i just not sure if the appsheet will continue to follow suit.
yes the timestamp in g sheet was from appsheet so i worry it will abnormally do what it does in this case. Iโ€™ll monitor and feed back

Good to know it works and thank you for the update.

I believe there could be some corrupt data earlier in the timestamp column.

However your concern is valid. I agree that you may wish to revert it back to the community or AppSheet support team if the same behavior takes place again.

Steve
Platinum 4
Platinum 4

A FILTER() expression, like this:

produces a list of key column values of rows that match the selection expression ([Timestamp]=MAX(Sales Summary[Timestamp])).

The result in the first app you referenced:

3X_f_c_fca341c058ab968e948b62d487f8497459c54361.png

is a list containing only one item, the key column value (fcdf1c07) of the one row of the Sales Summary table that matches the selection expression. That this list contains only one item means there is only one row in the table that has the maximum Timestamp column value.

In the second app you referenced, the same expression produced a list with multiple entries:

3X_3_4_3413396ba05d3a83f9842e5fd853a8b7d2aa1a9c.png

This indicates that each of the rows having the listed key column values have the same Timestamp column value, and that value is the maximum value. This is reinforced by this later screenshot from the second app:

3X_7_a_7aaf35e9dd4a73ff9bda0b63f59529562db0fc40.png

All of the displayed Timestamp values are identical. If I asked you to identify which one row from among those with that Timestamp value was the maximum, which would you choose?

Hi Steve,
with all identical, I will find it almost impossible to choose any of them because I need the timestamp value to be accurately associated with the key that I m looking for.
As I pointed out, I looked at the gsheet and found out that the timestamp column has all unique real datetime values and for some strange reason when I run the expression it picked up multiple same max values which it should have not been since there is really only one max timestamp value.

Top Labels in this Space