Ah! While I don't believe there is a currentColumn or anything similar, would something like this work for you?
ohh I knew it would something dumb - So yes this is the trick. Thought in my case it's counting non-intergers (booleans and strings), so need to work on that.
Hello,
I have the same problem. I verified the name of the column and it is the same but I got 0 as result ("not defined")
How can I do please?
Thanks
Hello! Happy to help.
Would you mind sharing a screenshot of what you're currently looking at / what's currently returning 0?
Hi, I belive I have the same issue. I did test the simple example you provided nov 21, at that works fine. But, using my real data, I am not able to sum price-column. Any advice?
Hi @lars_lysenstoen!
Thank you for the screenshot. You’ll notice in the little preview that table1.data is an array containing objects containing column names and values.
table1.data.price doesn’t actually return anything
However, since we want an array of all the price values, we can first convert our data object from an array of objects to an object of arrays (where each array contains all the values for each column):
formatDataAsObject(table1.data)
Then we can grab the price array like:
formatDataAsObject(table1.data).price
And now to sum it all up,
_.sum(formatDataAsObject(table1.data).price)
Let me know if you have any questions about this at all!
Thanks a lot, it solved my issue
So happy to hear that! Write back in anytime
Hello, I am having the same problem, but now seem to be getting strings. I am just trying to get a total from a column from my table. Many Thanks, Thomas
Hi @webm4ster !
You could definitely solve this - what if you tried something like:
{{_.sum(table1.data.map(d=>_.parseInt(d.total_price)}}
This will format your data in a way that allows for it to be summed
Thank you for your response and proposed solution. Sadly that didn't seem to work for me I'll keep trying.
Hey @webm4ster darn!
Can you send your data formatting? I'm sure we can figure out a solution for you here.
Hi Joey, I have the same problem, but unfortunately this didn't work for me
I really don't know how to do this... would you be so kind to help me?
Thank you so much!
Hey @victoria, thank you for your reply, I tried so many times and it was so simple!
I did change the name but I had to add more parenthesis
{{_.sum(table2.data.map(d=>_.parseInt(d.Total)))}}
Ah yup! Pesky parentheses. Good catch
HI i have a table where i need to sum only the select row and for selected columns only how can i do that
only the edited columns data need to sum and only selected row in table
Thanks this i have resolved
Just a brief update that in our new table component, summing up table columns in a "summary row" should now be much easier to configure! Check out this comment