DESKTOP EDITION CLOUD EDITION SERVER EDITION GUIDES FORUM

Calculating total of column


#1

@lubos
I am trying to calculate the total of a column but it takes the element as text and not as number. Inside the loop I have written this.
{% assign myVar = cell.text | convert: “number” | plus: myVar %}


Equation into a custom field & sum into another custom field
Bug related to Liquid language in Custom Theme
#2

Please do not divert topics with unrelated questions. Your post has been moved to a new topic.

This is not a coding forum. Users are responsible for their own custom themes.


#3

@lubos @Tut
Yeah so tell me how to access it as a number. I understand this is not a coding forum but the code which works on liquid IDEs doesn’t work in the custom themes. If it wouldnt have worked anywhere else then it’s my issue but if it’s not working only here,then you have to provide me with an alternative. Otherwise tell me table name in which the details of specific invoice are stored. Or give me alt approach to access the elements like using cell.text


#4

Is there any other way in which the cell elements can be accessed apart from using cell.text or convert them to a number?


#5

I will expose cell.value variable which would contain number. I already made it for custom fields but I think it should be done for cells as well.

What exactly are you doing? Using custom fields on line items and want to show total?


#6

Hi @lubos thanks for providing an alternative.
Yeah I am calculating the total of a column by accessing its HTML DOM in liquid and performing a sum on that to calculate the total of a column.

It can be thought as calculating the total amount or total quantity in a sales invoice. And then show the total.


#7

Added to the latest version (18.9.26).

Instead of “convert” filter (which didn’t work), use value property of cell instead.

For example:

{% assign myVar = cell.value | plus: myVar %}


#8

Hi
My name is Mohyadin Gure. I would like to contact to sales department.


#9

@Robb_Stark winter is coming and we need help to calculate sum on qty colum.
Can you help the seven kingdoms by sharing your custom theme? I have not good knowledge in liquid but i can modify a theme via trial and error if i have one?
Can you help please?


#10

Do not include personal information in your posts. Your email address has been removed. See https://forum.manager.io/faq.

There is no sales department to contact. Post your question on the forum.