So I have a table that receives various logs each day. This table has the profit for each day as well as some other stuff.
I want to create a panel with many charts/big numbers such as charts of daily profit or DoD, MoM comparisons, etc.
Hence, I figured a good way to tackle it was first to create a table with all the unique dates that currently exist for the user. If their first log was on July 1st 2024, there’s no need to have earlier dates on the table. Also, it has no set date to end; as long as the user keeps adding logs, more dates can exist. Logs can be created for future dates as well.
Lastly, I’m trying to keep it within Glide, so importing dates from, say, Google sheets would be a last resort.
The main issue here is that I can’t get around to creating this table with the unique dates
Any help is much appreciated! Thanks,
When you say “the user”, do you mean the currently signed in user, or some other user that is selected by the signed in user?
Correct, Darren; the currently signed in user
Okay, cool.
So just focussing on your primary question, which is to create a list of unique dates, you can do it as follows:
- I’m assuming that your Logs table contains the email address of the user that added each row
- Start by creating a table, and add enough rows as you are likely to need (one row for each unique date)
- Add a Row Index by following the 2nd method described here.
- Add a Query column, target it at your Logs table, filter it where User Email is User Profile->Email, and order it by Date descending
- Create a Lookup column, target it at the Query column, and select the Date from the Logs table. This should give you an array of all dates for the signed in user.
- Add a Unique Elements column and target it at the Lookup column. This will give you an array of unique dates.
- Add a Single Value column, target it at the Unique Elements column, and select
N
from start, where N
is the Row Index.
This should give you a list of unique dates for the signed in user, with one date per row.
1 Like