I came from AppSheet world to learn this platform and now I decided to enter this community and learn the kind of things that are not just on the documents.
A little context, I already made a exact clone (functionality wise) of an AppSheet app and it works great, aside from the unsupported offline mode here.
Now, on my journey I was a little shocked that I needed to create so much computed columns to get exactly what I needed.
Template columns seems to be the most flexible ones but they are just for concatenation stuff.
Let me put this scenario:
We have a Date column
We need to have a custom text column with the data presented this way:
2022-W15-M04-D12
AppSheet uses 1 single column for this, with an expression like this one:
My level of expertise is not high on GlideApps but I donât find a way to do this with less than 5 columns.
Can you give me a clue on what to expect on these situations?
Also, can you give me advice to get:
The last day of todayâs month
The first day of todayâs month
Is today a workday?
The last day of this week
The first day of next week
The last workday of this month
Just that for the moment
PD: Iâm not comparing AppSheet vs GlideApps or anything like that, but itâs important for me to know if I will be able to do things that Iâm used to here so that I know if Glide is the right tool for the job in my case.
Googling, I was able to do it in just one javascript column.
You can also make it dynamic.
I think you can search a bit of what you need and use this powerful column
------ CODE ----------------------------------------------------------------------------------------------------------------
let currentdate = new Date();
var oneJan = new Date(currentdate.getFullYear(),0,1);
var numberOfDays = Math.floor((currentdate - oneJan) / (24 * 60 * 60 * 1000));
var result = Math.ceil(( currentdate.getDay() + 1 + numberOfDays) / 7);
let output = currentdate.getFullYear() + â-Wâ + result + â-Mâ + String(currentdate.getMonth()+1).padStart(2, â0â) + â-Dâ + String(currentdate.getDate()).padStart(2, â0â);
Hi @JuanM, thanks for pointing that out, I noticed the Javascript column but left it out considering that JS is a whole new level for a no-code platform, I guess Iâll take it as the springboard to my coding career
Itâs safe to say that Glide is closer to coding while AppSheet is closer to gsheet/msexcel expressions (which some people may consider coding at some level)?
Last day of todayâs month
(NOW-DAY(x)+15)+30
-DAY((NOW-DAY(x)+15)+30)
(@Jeff_Hager shared this one once while I was holding his beer.)
The first day of todayâs month
NOW-DAY(x)+1
Is today a workday
Assuming workdays are from Monday (day 2) to Friday (day 6):
WEEKDAY(x) column then If-Then-Else column: If WEEKDAY=1 or 7 then false else true
Last day of the week
Assuming weeks starts on Sunday (which they donât in my part of the world)
NOW-WEEKDAY(NOW)+8
First day of the week
Assuming weeks starts on Sunday (which they donât in my part of the world)
NOW-WEEKDAY(NOW)+1
Last workday of this month
This makes me want to Google it Sorry I have no idea.
I think that each one has its context, although I have not used appsheet since glide has covered my needs with its flexibility, community and its constant growth.
I think so, glide gets a little closer to coding with the javascript column and css tricks that are here in the community.
Interesting you say that Glide is closer to coding: I would say that some level of logical thinking is required in Glide (at the very least useful), but other than basic math formulas, I donât think I write a line of code using Glide. I wouldnât be capable of it anyway
(The JS column and CSS are not necessary and used only to push the limits of the platform. Most gliders most of the time donât need to know about these.)
I would probably have used math columns to determine year, month, day. I donât know what I would have done for week (maybe a math column with mod?). And then I would have brought the information together in a template column to concatenate. Your method worked!
Itâs true that while in GS/Excel, one can use an onion approach and eventually create one long formula for one column, in Glide each formula lives in its own computed column. You can, if you like, move columns next to one another and group your columns neatly in your tables by using using â/â (GroupA/ColA, GroupA/ColB, etc.).
Thatâs why I donât compare AppSheet to Glide in this context.
Whatâs VERY easy on one of the platforms means âpushing the limitsâ on the other one.
Think about the UI for example, Glide itâs clearly miles ahead of AppSheet. The only workarounds we have are Rich Text columns with some html (no CSS support) and image columns where we could create dyamic SVGs.
Document/reports generation and webhooks, the other way around, Glide relies on third parties while AppSheet has a native way to make http calls (although no response procesing).
I wouldnât say one is better than the other, Iâm enjoying the process of learning Glide while keeping AppSheet knowledge in my head to use the right tool for the job when I need it
There you have it, 5 columns. Thatâs what I determined with my current knowledge until the JS solution does the same with one column.
Also, would more computed columns affect performance? On AppSheet we kinda keep track of âcomputed columnsâ (virtual columns), specially when there are complex expressions inside of them.
Naturally, this leads me to think that Glideâs computed columns may affect performance.
Another one, how many tables does your biggest app has?
Because the biggest one I have on AppSheet has around 40-45 and to make sense of Glide pricing I will need to merge other ones into one big platform and that would rise the tables to 60-70
In the forum you will find many topics about optimizing performance, ranging from best practices in the builder (UI) to tables (in Glide, in 3rd party tools) to row ownership (to reduce the amount of data downloaded to your usersâ devices and computed there).
Some builders have built gigantic apps (Iâm not one of them : )
On a Glide community call which might have been about a year ago now, @Mark_Turrell blew everyone away, including members of the Glide Team, when he showed us the mindmap of his app and the roadmap.
I thought this would be a little more straight forward until I started messing with it. Check my math on this, but I think itâs working. I only tried a few different dates. One with a month that ends on Sunday, one that ends on Saturday, and a couple others that end on Mon-Fri. The first part is the same as your Last Day of the Month math. Then I basically subtract a day if itâs a Saturday, and subtract 2 days if itâs a Sunday using some Min/Max magic.
Yes, it does. The initial part of the formula takes the date, subtracts the day number from that date, so you end up with the last day of the previous month. Then it adds 15 days to get you approximately in the middle of the month, then adds 30 days to get you approximately in the middle of the next month. Then the formula is done again, but gets the day number from that calculated date and subtracts the day number from the newly calculated date. Then end result is always the last day of the current month. The rest of the formula, with the MIN and MAX, is a trick to mathematically perform a sort of IF condition to subtract 1 or 2 days depending on if the last day of the month falls on a Saturday or Sunday.
So, to answer your question, it doesnât matter how many days are in a month. It always figures out the last day of the month and then figures out the last workday in that month.
Math was never my favorite subject, but I did OK with it to get by. Yeah this one took me a little bit to figure out. I thought it would be as simple as combining a couple of your formulas together, but that wasnât quite working out.
You know the first part is the whole formula to calculate the last day of the month, which is also the core of the Min and Max formulas.
The Min formula will return either 0 or -1 since Saturday (weekday 7) would be the only day that we calculate something less than zero (6-7=-1). The Min will return the lesser of 0 or -1. Adding a -1 to the last day of the month gives you the prior day, which would be a Friday.
The Max formula will return either 0 or 2 since Sunday (weekday 1) would be the only day that we calculate something greater than zero (2-1=1). The Max will return the greater of 0 or 1. Then we take that result and multiply by 2. So first we will only ever calculate 0 or 1, and by multiplying by 2, we get an end result of 0 or 2. That way we can subtract 2 days from Sunday to get Friday, if the last day of the month falls in a Sunday.