šŸ§® New Math functions

Try this:

500*ROUND(X/500)

5 Likes

Hi Glide Team, I agree with @wjcv06 and would also like LEFT, RIGHT and SUBTRING functions ?
In my case, need to find a workaround to show differents time periods for charts with https://quickchart.io/ : data presented as in a stringt list with coma separations !

Screenshot 2020-10-18 at 19.00.22|245x500

1 Like

how about a ternary operator like
predfact=medfact * (sex='F" ? 1.018 : 1.000)

although i would rather have it as
predact=medfact * (if sex=ā€˜Fā€™ then 1.018 else 1.000)
or
predfact=medfact*(if sex=ā€˜Fā€™ then lookupF(age) else lookupM(age))

ie. the values returned by the conditional statement are inline values or variables, or values of functions or other math expressions

2 Likes

it works well, thanks!

2 Likes

Waiting for countifs and average if for automate counting survey resultā€¦ :smiley:

1 Like

Jeff - I thought this syntax could work for rounding (always) up the current time to nearest 0:30 min using ceiling function. First, tried X as a now math column. Then tried incorporating now within the formula. Iā€™m stumped. Any insight?

is it possible to round up to exact places after the dot?
something like from 1.423 to 1.43

@administrasi_kitsda Have you looked into using relation, rollup, and math columns to get counts and averages?

@Rasha I spent some time last night trying to come up with a math formula to do that. I feel like Iā€™m close, but I donā€™t know yet if itā€™s possible.

@A.I.Office I donā€™t think you can specify number of decimals, but if you take your value, multiply by 100, Perform a Ceiling on that result, then divide by 100. Should look something like CEILING(X*100)/100

6 Likes

iā€™ll try that, thanks :slight_smile:

1 Like

Appreciate the time you spent on this @Jeff_Hager. I can live without for the time being.

1 Like

@Rasha I think I got it. I feel pretty good about this one. This formula will calculate the time to the next half hour. It does float between 0 and 1 seconds after the minute, but appears to stick on the exact minute of the next half hour and switching to not show seconds will give you a good view. I did watch the time switch from 5:59 to 6:00 and after that, the value changed from 6:00 to 6:30, so I feel pretty good about it.

The kicker here is that this will require a seed date. This will need to be a column with a date/time. The date and hour can be anything, but the minutes and seconds need to be on the hour, so equal to 0. For example, this is what I have as a seed date/time.
image

This is the complete math formula:

X+
(
CEILING(((X-Seed)-ROUND(X-Seed))/.0208333)
-
FLOOR(((X-Seed)-ROUND(X-Seed))/.0208333*1000)/1000
)
/48

Hope it works for you.

Edit: This may be better and just a hair more accurate. Basically the same either way.

X+
(
CEILING(((X-Seed)-ROUND(X-Seed))*48)
-
FLOOR(((X-Seed)-ROUND(X-Seed))*48*1000)/1000
)
/48
10 Likes

@Jeff_Hager your help on this one is invaluable - a million thanks! I think the seed column wonā€™t present an obstacle to flow - weā€™ll see. Will work through this in the coming days and share where I end up.

2 Likes

TRUNC(Number, 2)

Is this possible to just TRUNC to a certain decimal point? like does it take two arguments?

Looks like only 1 argument. If you want 2 decimal places, just multiply the number by 100, Trunc that result, then divide by 100. I would think Floor would probably do the same thing.

TRUNC(X*100)/100

But what about something like 23.45637?

And I goal is the just and only cut down to 23.45 without it auto rounding.

Yep, thatā€™s why you multiply by 100 to move the decimal to the right 2 places, then the Trunc will remove anything to the right of the decimal. Finally the divide by 100 will move the decimal back to itā€™s original location. Trunc (and Floor) wouldnā€™t round anything with the formula I gave.

Good Morning

@Jeff_Hager, You can call me Buddha (nickname) My name is Franklin. Sorry to bother you, but
Iā€™m having a problem with a service scheduling app, Iā€™ve been trying for a month and I havenā€™t found a solution, Iā€™m new to the developer area and Iā€™m not able to do the logic. In this app there are 2 attendants with 10 services and the duration of the hours is 6 different. (ex: service 01 duration 1/4 hour.
service 5 duration 2h
service 10 duration 4 h.
I can put in the hours, but if I select time 10 that lasts 4 hours, I need to make the other servicesā€™ schedules disappear ā€¦ and I donā€™t know how to do it. these date and time calculations.
Would you help me?
Iā€™m from Brazil and Iā€™m using the google translator, forgive if there are any errors ā€¦

I would use these mostly to fiddle with names. ie. to extract just the given name or family name from a full name. Isnā€™t always 100% reliable, but avoids having to use multiple columns to store names.

Edit: Actually, having those functions available would solve the problem that I described here (ie. instead of doing the string manipulation in the GSheet and waiting for it to sync, I could have it done instantly in Glide)

2 Likes

Has this been rolled out?

Has there been any update to add math functions like LEFT?

Use case: weā€™re creating an app to help my wife and I collect and test names for our new baby. I built a feature to concatenate a First + Middle + Last name so we can see how the full name looks. My wife is now asking if we can have some display that shows the initials, ie FIRST MIDDLE LAST would show ā€œFMLā€ (woahā€¦).

My approach to this would be using Left(FIRST,1) + Left(Middle,1), etcā€¦ but it doesnā€™t look like this is possible right now.

1 Like