New computed column: Math

https://docs.glideapps.com/all/guides/quick-starts/intermediate-techniques/calculating-columns

2 Likes

I think itā€™s addressed why calculating columns are to be avoided and the beauty with the math column; itā€™s the instant results versus the buggy and slow results between calculating columns communicating with Glide. At first, I relied heavily on IFS(), IF(), ARRAYFORMULA(), etc. but it was creating a really slow and frustrating app. Since then, Iā€™ve done my best to incorporate relations, single value, lookup, math, template, and if columns. Itā€™s really made a world of a difference in speed and responsiveness.

4 Likes

I would like to upload a screenshot video I took of my app, this part still in development, but Iā€™ve managed to add a loading screen that only appears during the minute it takes for the app/sheets to communicate to populate a result from an sheets formula.

Earlier I mentioned log10, because itā€™s not recognizable in math column, I reverted back to using sheets, and the loading screen makes waiting kind of comfortable. I was going to use math column for basic number results, but then I stumbled upon the decimal problem, I might go back to sheets to fix this as well. Unfortunately sheets canā€™t pull results from other glide columns so I have to backtrack a lot.

But, the loading screen I created was a pretty comfortable solution to waiting for app/glide to communicate.

I used an if column,
Input (1,2,n) all equal IMG 1 (ā€œneed more infoā€) if EMPTY.
Input for result column, equal to IMG 2 (ā€œloading.gifā€) if EMPTY.
ELSE IMG 3 ā€œshows result IMGā€ alongside result column that was loading.

I use visibility to hide this Glide IF column when the switch is not TRUE. I have to use the edit button because Glide updates everytime an input is adjusted, and there are several inputs, so edit prevents this by submitting all at once.

1 Like

Do upload the video. I didnā€™t follow 100% of how you did it but it does sound interesting.

2 Likes

Sorry about the video being four minutes long.
Note thereā€™s a few hiccups with Glide where the form resets.
I donā€™t know how to mitigate thatā€¦ So, the user is forced to resubmit information a few times.
Or, come back to the app after a natural update (pro) to see their information.

Glide team, let me know if there is a fix to that.
But for others, if the form didnā€™t reset, it shows loading dots until the arrayformula feeds back to Glide.

Note: Iā€™m reaching 600 users soon, although itā€™s only been up a few weeks, so Iā€™m trying my best to get rid of any errors and save some face. lol

Really appreciative to how fast the Glide team works, thanks!

1 Like

Iā€™m sorry, I have a very hard time following this video. Everything happens very quickly and there is no indication of where youā€™re tapping.

Would you mind showing a clearer demonstration of forms resetting? I canā€™t detect any of that in this video.

OK, so itā€™s all Japanese because this app is for a Japanese audience.
For example, at 00:31 I go back to the form I just submitted to click TRUE on the next section, with three new inputs, measurements below the adamā€™s apple, above the iliac crest, and the userā€™s height.
At 00:39, I submit, the information should be in the form.
This feeds into an arrayformula, with earlier measurements, to draw up body fat percentage based on the U.S. Navy formula, in metric units.

At 00:52, it reverts back to the START image, which should only show if the first three measurements are EMPTY.

At 00:53, I go back in the form and see all the measurements I submitted are empty. This form is filtered per user email, so it shouldnā€™t be empty. I refill the information.

It goes back to the loading gif.
At 1:28, the arrayformula finally feeds back into Glide and the userā€™s body fat percentage is displayed alongside accompanying graphics.

In the video, this happens after the next section is submitted, and also for the map section.

Since the video isnā€™t there for me, Iā€™d like to just confirm that, according to the image, the neck bone is indeed connected to the hip bone.

The Math column now has a LOG function that works like the one in Google Sheets.

What would you say is the usecase ? :wink:

Jeff Bezos uses it to calculate the number of zeros in his bank account balance.

4 Likes

Haha, but I hope that you pay taxes when you become as rich as Jeff :wink:

@erwblo just read the prior posts in this tread and you will see the use case that @gg_0511 gave.

Hi,
I want to display three values in my form: Total, Tax and Grand Total (=Total + Tax). I defined two columns in my Google Sheet, ā€œTotalā€ and ā€œTaxā€, and I create a Math column: Grand Total=Total + Tax in ā€œDataā€ tab.

In the form, I can display only two components (Total and Tax), cannot find Grand Total. Is it impossible to display computed column in the form, or I miss something here? (In the Data tab, the Grand Total shows correct value).

Unfortunately, computed columns donā€™t yet work in Forms, or add/edit screens for that matter. We will fix that eventually.

Hi @Mark, good morning!

I have a strange behavior with the Math component when I carry out a simple sum:

Total= PreciosP1+PreciosP2+PreciosP3

I just want to show Total Price of 3 products if a customer chooses 1, 2 or 3 items. The problem appears when the customer chose 1 or 2 items only, the sum is not performed!

Of course, everyting works fine if there are 3 products (values) in the sum. I think the problem source are the empty values in PreciosP2 or PreciosP3.

image

Is there a bug or a workaround for this?

Thanks in advance for your help

Saludos

Gavp

I see. Right now the only workaround would be to make an If-Then-Else column for the potentially missing columns that produces 0 if theyā€™re missing. But I think I have a reasonable way of handling this in the Math column.

1 Like

OKā€¦ I can live with it meanwhile.

The Math column has another detail working with external formats. As you can see in my image, the numbers 767.34 and 383.67 must be 767.340 and 383.670 (we use ā€œ.ā€ as digit grouping not decimals).

I mean, if you sum (127.449 + 127.890 + 128.331)*2 the total must be 767.340 (seven hundred sixty-seven thousand three hundred forty). Itā€™s a litle problem that brings with the globalization! :slight_smile:

image

Saludos a todos.

Gavp

For now youā€™ll have to format numbers in your Google Sheet using the period as the decimal point. Weā€™ll make it possible for you to tell Glide that a column is definitely a number column, and then itā€™ll work no matter what your format is.

Hi,
https://docs.glideapps.com/all/reference/data-editor/math-column
I noted that the Math Column now can display instant result, but cannot find it when adding new components & value. Is the feature fully implemented, or just roll out to paid user?
Thanks
Anh Han