Calculation element Count record with multiple value

Status
Not open for further replies.

panca

New Member
Hello Master All,
I have list that have column L/P (SEX).
My questions : how to count record that value are male and female.
Ex result: Male : 19. Female : 20.
Because count value record only one in each element ...

sorry for my english... help me pleae ... thank you.. :)
This is my screenshoot.. I want to count record that value "Laki-laki" and "Perempuan" in column "L/P"...
2bp3x3.png

B178Gqb7G770AAAAAElFTkSuQmCC
 
Go into the element editing for the column you want to count.

go to the List View tab top right.

Expand the Calculation section at the bottom

Use the Count Records section and put Perempuan in the count value field and this should give you the number of times Perempuan appears.
 
How about "Laki-laki"

Go into the element editing for the column you want to count.

go to the List View tab top right.

Expand the Calculation section at the bottom

Use the Count Records section and put Perempuan in the count value field and this should give you the number of times Perempuan appears.

How about "Laki-laki" ? I want to count "Laki-laki" and "Perempuan" it's that possible to count multiple records at one coulumn/element ???
 
if all the records are either A or B counting the A number will give you the B number by subtracting from the number of rows.
use validation on the element to make sure only the right two entries are allowed
read the tutorials for further help
 
If a regular form view is OK, you could set up a display element to show the result of a mySQL query that performs the calculation. Basically, you would put something like the following in the Default field and set it to Eval. You would obviously need to work out the proper query for your setup.

Code:
$db =& JFactory::getDBO();
$query = "SELECT COUNT(*) FROM `your_table` WHERE `element` = 'female'";
$db->setQuery($query);
return $db->loadResult();

Here is an example of what I am talking about:
http://www.mypoolstats.com/player-rating-stats/form/18

The Content plugin allows you to put F! content into Joomla articles. I have not used it myself yet. I think it is only for forms, lists, and visualizations, not really for summary calculations but I could be wrong.

http://fabrikar.com/wiki/index.php/Content_plug-in3

Check it out and play around with it. You might be able to combine these two methods to achieve what you are after.
 
If a regular form view is OK, you could set up a display element to show the result of a mySQL query that performs the calculation. Basically, you would put something like the following in the Default field and set it to Eval. You would obviously need to work out the proper query for your setup.

Code:
$db =& JFactory::getDBO();
$query = "SELECT COUNT(*) FROM `your_table` WHERE `element` = 'female'";
$db->setQuery($query);
return $db->loadResult();

Here is an example of what I am talking about:
http://www.mypoolstats.com/player-rating-stats/form/18

The Content plugin allows you to put F! content into Joomla articles. I have not used it myself yet. I think it is only for forms, lists, and visualizations, not really for summary calculations but I could be wrong.

http://fabrikar.com/wiki/index.php/Content_plug-in3

Check it out and play around with it. You might be able to combine these two methods to achieve what you are after.

Sorry, I think not like that i mean and sorry for my english.
Others problems others solutions.
I have try many way to solve my problems and try search on this forum or googling.

I just want how to display only calculations from list table without list table only summary of calculations.
I have try content plugins and i think there is no way to only display calculation element without list table.

And the last i try to make custom template list from copy of default template and delete the coding to display list.

and this is the screenshoot :
attachment.php


Thanks for your help :)
 

Attachments

  • Capture.PNG
    Capture.PNG
    19.4 KB · Views: 2,321
Just an observation. I think Rackem has outlined how to get the data very well, but to present it, I was wondering iof this would help.

If you set up another new table called 'calculation results' with the field headings you have in the example above, you could join it to the original tables, and use a group of calc fields to calculate values for each of your categories.

So the table would have maybe have a 'Budha' element which uses calc on the joined table to count the number.
Similarly have another field for each of your different categories, with the calculation being done on the joined table(s).

Then when you display the 'Calculation results' form you would just see


Budha ---- 325
Hindu ---- 401
Jedi ---- 7

etc.

Each time you display the Form for the Calculation Results table(list) it would automatically refresh the data... and just show what I think you want, the numbers.

NickB
 
Just an observation. I think Rackem has outlined how to get the data very well, but to present it, I was wondering iof this would help.

If you set up another new table called 'calculation results' with the field headings you have in the example above, you could join it to the original tables, and use a group of calc fields to calculate values for each of your categories.

So the table would have maybe have a 'Budha' element which uses calc on the joined table to count the number.
Similarly have another field for each of your different categories, with the calculation being done on the joined table(s).

Then when you display the 'Calculation results' form you would just see


Budha ---- 325
Hindu ---- 401
Jedi ---- 7

etc.

Each time you display the Form for the Calculation Results table(list) it would automatically refresh the data... and just show what I think you want, the numbers.

NickB

Thank you nick, but it was too complicated for me :), is there a tutorial to do that? so I knew it was the right solution for me. Thank you in advance.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top