Auto sorting Spreadsheet - sorting

I am new to spreadsheets. I am using it as my backend. I want the new responses to b in the first row, i.e. the whole table should be sorted in the descending order of timestamp. In column 1 I have a time stamp. I have columns till J. So how to sort the table automatically so that whenever the new responses come the table is auto sorted. I did check this.
But I don't understand how to apply data formula to my spreadsheet.

I think either of these should work for you:
=SORT('Datakk (Responce11)'!A2:J,1,0)
=QUERY('Datakk (Responce11)'!A2:J,"order by A desc")

Related

Additional row with empty header in matrix in power bi

The problem is probably trivial but unfortunately I can't figure it out. Here are two basics tables:
I tried to create the matrix based on the selected ID (from the Table2) with values from Table1. I created a measure "% Margin" (margin divided by revenue) and tried to add this to the matrix with ID from Table2. Every time besides ID from Table2 I got one additional row with empty ID. Anyone has an idea how to get rid it off? The rest of the matrix is correct.
Instead of using a separate static table, simply add a new column to you table and use that to filter your data for the report.
Here's how this would look like:

Insert a new Google Sheets row into Alphabetically Sorted spreadsheet

I am working with two spreadsheets; the first spreadsheet takes a name and then automatically adds it to the next spreadsheet which is sorted alphabetically by name. The problem is, I need a new row to be created, otherwise the data from the row above it gets added along with the name. Here is the query I am using: '=query(Referrals!A2:O, "select * where C is not null order by D")'. I don't think this can be done with a query, so I have been exploring Google App Scripts. I am not sure how to insert into the pre-sorted list, though. Any help is greatly appreciated!
Have you tried offsetting the header so you can run it for the range of the sheet?
=query(Referrals!A:O, "select * where C is not null order by D Offset 1")
That seems to fix some of the issues I've come across.
EDIT:
What about using a filter formula?
=sort(FILTER(offset(Referrals!$A:$O,1,0),offset(Referrals!$C:$C,1,0)<>""),4,true)
If using Apps Script, then you can directly insert a row (via Sheet.insertRows(rowIndex, numRows)) into the sheet at the desired index. But I believe you can achieve what you want by mapping the data in "next spreadsheet" to the names imported via "query" using VLOOKUP. That way when new data is added to "first spreadsheet" it will be sorted accordingly with your formula, but now the data associated will move rows to continue matching their respective row.

Get Top 10 values in Google Sheets Pivot Table

I have a Google Sheets pivot table with sales values of transactions in descending order. I want to modify the pivot table to only show the Top 10 sales values. The source data for the pivot table is being updated daily, so naturally, the Top 10 values will be changing as time progresses.
How can I do this in Google Sheets?
directly in the pivot table, it's not possible so you need to use some formula to trim it and then use pivot table from there:
=QUERY(A:B, "limit 10")
There is a good function in Google Sheets called SORTN which return any number of values in a range sorted as you want.
Use it on another sheet, the data will update automatically when value in the source range change.

Auto sorting rows based on the values in a specific column?

Here's a sample table. It only has one formula which computes the total.
https://docs.google.com/spreadsheets/d/1WW0uvAx3JfXkAt8qW89H4fHUTDmaY-zsjkhtaXQaJIM/edit?usp=sharing
I'm looking for a way that the table will automatically sort itself based on TOTAL column, after I input a new item in the list.
I know this can be done manually but automating it can really help me save some time.
In which case please try:
=query(Sheet1!A:D,"Select * order by D desc ")

How to get the last "row" in a cassandra's long row

In Cassandra, a row can be very long and store units of time relevant data. For example, one row could look like the following:
RowKey: "weather"
name=2013-01-02:temperature, value=90,
name=2013-01-02:humidity, value=23,
name=2013-01-02:rain, value=false",
name=2013-01-03:temperature, value=91,
name=2013-01-03:humidity, value=24,
name=2013-01-03:rain, value=false",
name=2013-01-04:temperature, value=90,
name=2013-01-04:humidity, value=23,
name=2013-01-04:rain, value=false".
9 columns of 3 days' weather info.
time is a primary key in this row. So the order of this row would be time based.
My question is, is there any way for me to do a query like: what is the last/first day's humidity value in this row? I know I could use a Order By statement in CQL but since this row is already sorted by time, there should be some way to just get the first/last one directly, instead of doing another sort. Or is cassandra optimizing it already with Order By statement under the hood?
Another way I could think of is, store another column in this row called "last_time_stamp" that always updates itself as new data is inserted in. But that would require one more update every time I insert new weather data.
Thanks for any suggestion!:)
Without seeing more of your actual table, I suggest using a timestamp (or timeuuid if there is a possibility for collisions) as the second component in a compound primary key. Using this, you can get the last "row" by selecting ORDER BY t DESC LIMIT 1.
You could also change the clustering order in your schema to order it naturally for "last N" queries.
Please see examples and linked resource in this answer.

Resources