Hi All,
I am working on a automated report that needs to send the last 3 cells of a sheet. I have found a formula with MAXROW that sends the last row, but I cannot find a way to make it do MAXROW (Minus 3).
Can someone help me with this? I feel like this is a simple fix and I'm just too close to the project.
Thank you in advance
Solved! Go to Solution.
Okay, my previous solution did not work.
Here is how I solved it:
1. Created a slice with formula: [TIME]=MAX(Notifications[TIME])
2. had a report call the slice, Condition set to: "true"
NOTICE: All of my records have a timestamp on when they are moved from one sheet to another (External tool). By pulling the MAX time, I was able to ensure the most recent time was selected.
Thank you for everyone's help!
I may have solved it, but still open to other/better solutions.
Step 1: Made a virtual column called "timecheck" with formula [_thisrow].[time]=MAX(sheet3[time])
Return value = Y/N
step 2: Report Filter set to "Y" for [timecheck]
As long as you put the items in the correct order:
TOP([Your_List_Here], 3)
thats an interesting solution, but one of the feature I am unable to change is that new rows are added to the bottom. If only there was a BOTTOM() .. hah
That's what OrderBy() is for
Once you have found the last row with MaxRow, this formula should get the last three records (-3):
For example,
Filter(
"Some_Table",
[_RowNumber]>
Index(Select(Some_Table[_RowNumber], [ID] = MaxRow("Some_Table","_RowNumber")),1)-3
)
This would return the last three (-3) records of Some_Table based on _RowNumber.
It basically translates to: "Once you have found the last record of Some_Table based on _RowNumber, then get that record's _RowNumber, substract 3 and Filter the table Some_Table using as condition that _RowNumber should be greater than the resulting number. In essence, the last 3 records.
I like this - but it doesn't work in a report filter. I am working on turning this into a yes/no ..
@Travis1 ,
It's great that you found a way. I am a bit curious about what you are trying to accomplish. Whatever it may be, I'd probably try out @MultiTech solution in the future seeing that it's probably more efficient (using built in functionality over custom queries such as mine).
@jrullan Gotta start somewhere, and brute force is actually where I usually start if I'm unsure if something is possible. ๐ If the monster of a formula works, then I'll go about finding ways of making it more efficient.
And the solution I pointed out here, might not actually fit this situation. As @jrullan alluded to, @Travis1 you never really gave us much insight as to what or where you were trying to accomplish this.
Okay, my previous solution did not work.
Here is how I solved it:
1. Created a slice with formula: [TIME]=MAX(Notifications[TIME])
2. had a report call the slice, Condition set to: "true"
NOTICE: All of my records have a timestamp on when they are moved from one sheet to another (External tool). By pulling the MAX time, I was able to ensure the most recent time was selected.
Thank you for everyone's help!
Hi @Travis1
Thanks for your message. I want to create a PDF report with all rows from a specific tab and send it by e-mail. I am a bit lost between functions : Start, Max etc..
Your example seems a bit more complex than mine, but I am a bit lot on where should I put all theses formulas.
Could you help me ? ๐
First: Follow this link for the solution: https://support.google.com/appsheet/answer/10107704?hl=en#:~:text=Rows%20with%20highest%20values
So... much... inefficiency.... in this thread....
----------------------------------------------------------------------------------------
A note on SELECT()
----------------------------------------------------------------------------------------
The select() statement is literally brute force - any time you use it, you're telling the system:
If you've got something like:
Filter(
"Some_Table",
[_RowNumber]>
Index(Select(Some_Table[_RowNumber], [ID] = MaxRow("Some_Table","_RowNumber")),1)-3
)
You're saying:
You see why Chef Ramsay's head is about to explode? ๐
Nested SELECT() (which includes any of the ports as well) is a huge no-no
-----------------------------------------------------------------------------------------
Well what do I do then!??!??
TOP() allows you to pull out the top X values from a list
In the documentation for TOP, they actually answer the question of this post... exactly what you need to do is explained, with details for each step so you can understand what's happening at each stage.
Follow this link for the solution: https://support.google.com/appsheet/answer/10107704?hl=en#:~:text=Rows%20with%20highest%20values
TOP(
OrderBy(
Table[TableID],
[_RowNumber],
true
),
3
)
Or you could base things on that timestamp column you have... that's what I would do.
๐
User | Count |
---|---|
17 | |
12 | |
5 | |
5 | |
5 |