Skip to Content Skip to Menu

[SOLVED] Plotalot and Community builder

  • diogotu
  • diogotu
  • OFFLINE
  • Posts: 138
  • Thanks: 4
  • Karma: 0
11 years 1 month ago - 10 years 6 months ago #234676 by diogotu
Hi,

I started to use plotalot, that make chart with joomla sql queries data. And get a statistic chart for CB fields.

I have a CB field single-select [dropdown] and i would like to make a chart with that field.

This field have 3 values, and i would like to make a query to get the value of how many of each i have, for example:

teachers, [joomla query for nº of teachers]
students, [joomla query for nº of students]
parents, [joomla query for nº of parents]

and get the results:

teachers, 15
students, 75
parents, 23

Thanks
Last edit: 10 years 6 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
11 years 1 month ago #234690 by krileon
Replied by krileon on topic Plotalot and Community builder
Do a COUNT select query on _comprofiler with a WHERE statement for your dropdown fields column. Please see the below tutorial on how to create a COUNT select query.

www.w3schools.com/sql/sql_func_count.asp


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • diogotu
  • diogotu
  • OFFLINE
  • Posts: 138
  • Thanks: 4
  • Karma: 0
11 years 1 month ago - 11 years 1 month ago #234705 by diogotu
Replied by diogotu on topic Plotalot and Community builder
Thanks,

Really nice. I think i'm getting close to my first sql "code".

I wrote that code but some thing is wrong could you help me to figure out what?
Code:
SELECT COUNT (jos_cb_fieldname) FROM jos_comprofiler WHERE jos_cb_fieldname=teachers

But i get a error on the syntax!

thanks
Last edit: 11 years 1 month ago by diogotu.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
11 years 4 weeks ago - 11 years 4 weeks ago #234763 by krileon
Replied by krileon on topic Plotalot and Community builder
You didn't use any apostrophes or quotes to designate tables/columns and values. You also don't need to table prefix every column and don't need the prefix for queries using Joomla as it'll auto replace #__ with the prefix. Please see the below.

Code:
SELECT COUNT(*) FROM `#__comprofiler` WHERE `cb_fieldname` = 'teachers'


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 11 years 4 weeks ago by krileon.

Please Log in or Create an account to join the conversation.

  • diogotu
  • diogotu
  • OFFLINE
  • Posts: 138
  • Thanks: 4
  • Karma: 0
11 years 4 weeks ago #234875 by diogotu
Replied by diogotu on topic Plotalot and Community builder
Thanks

Please Log in or Create an account to join the conversation.

  • imaaxx
  • imaaxx
  • OFFLINE
  • Posts: 126
  • Thanks: 11
  • Karma: 2
10 years 6 months ago #244429 by imaaxx
Replied by imaaxx on topic Plotalot and Community builder
Hello,

I have recently found this component as well and i would like to be able to create bar graphs. In our CB fields we have created fields for each day of the week and for certain times. When members fill this out it shows the site owner the best days for planning events. The fields are named like this: cb_monday, cb_tuesday, cb_wednesday and so on.

I want to show the results of how many members are available for a given day.

Example: Monday 5, Tuesday 7, Wednesday, 3 and so on then use this data in a bar graph so everyone can see how many people are available. I hope I'm making sense. Anyways i am not a programmer so i don't really know what to do or how to craft the code to work.

Thanks for any help with this.

Regards
Alan

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum