Let me say I write items to a database. That works fine!
For example is save to database:
columns: name - cat1 - cat2 - cat3
cat1 cat2 and cat3 are all integers
I want to display the sum of each column to the site.
Can that be done, I found helpitems for this from 2010 but they don't work anymore.
Kind regards
For example is save to database:
columns: name - cat1 - cat2 - cat3
cat1 cat2 and cat3 are all integers
I want to display the sum of each column to the site.
Can that be done, I found helpitems for this from 2010 but they don't work anymore.
Kind regards
Hi Joeri,
You will need to use a "Read data" action and in the "Field to retrieve" box use:
You will need to use a "Read data" action and in the "Field to retrieve" box use:
SUM(cat1):cat1_sumThen you can extract the result using a shortcode, if your "Select type" is set to "first matching" then you need something like this:
{var:read_data_name.Model_name.cat1_sum}Best regards
Hi joeriFranck ,
It's not simple to sum values in the same row using MySQL so probably the best solution is to use a Custom Code or PHP action after you load the data, calculate the total and add it to your form data as a new entry.
Bob
It's not simple to sum values in the same row using MySQL so probably the best solution is to use a Custom Code or PHP action after you load the data, calculate the total and add it to your form data as a new entry.
Bob
@admin: i did this:

and then this:

That doens't work in frontend there is no result.
At greyhead, only the columns is good for me
and then this:
That doens't work in frontend there is no result.
At greyhead, only the columns is good for me
Hi joeriFranck,
The "read_data_name" in your case is "read_data11"
Best regards
The "read_data_name" in your case is "read_data11"
Best regards
with <p style="text-align: center;">{var:read_data11.totaalcat1.cat1_sum} --</p>
it doens't work either
it doens't work either
Still no sollution,..
I need this now for another form to but have still no clue
It's been more than a month now ?? Somebody?
Hi JoeriFranck,
You said that the column names were cat1, . . . but in one of your images you have SUM(_catagorie1) . . . is that correct? It would be unusual to have a column name starting with an underscore?
Bob
You said that the column names were cat1, . . . but in one of your images you have SUM(_catagorie1) . . . is that correct? It would be unusual to have a column name starting with an underscore?
Bob
model.field1:field1
model.field2:field2
model.field3:field3
(model.field + model.field2 + model.field3):model.alias
model.field2:field2
model.field3:field3
(model.field + model.field2 + model.field3):model.alias
This topic is locked and no more replies can be posted.