• Resolved yerooon

    (@yerooon)


    Hi!

    I wonder if the following is possible with this plugin:
    (I can better use an actual example than a vague question I think)

    I have a site where people use Contact Form 7 (DB) to answer a few questions, which are stored in the database. Let’s say one of the answers is based on five ‘colors’ from which they can choose, for example. Now, I want to show a (real time) pie chart thats shows all five categories and the percentage of answers. Let’s say there are 10 people with these answers: 5x blue, 2x red and 3x yellow.

    Can I show this? There’s one one query possible, so I’m not sure.

    I’m using something like this:
    select * from wp_database_submits where field_name = "color"

    These are the raw query results (actually in random order):
    Blue
    Blue
    Blue
    Blue
    Blue
    Red
    Red
    Yellow
    Yellow
    Yellow

    Is there a way to show that 50% picked blue, 20% red and 30% yellow? In a pie chart?

    Any help would be greatly appreciated! ??

    https://www.ads-software.com/plugins/wp-business-intelligence-lite/

Viewing 1 replies (of 1 total)
  • Hi in order to be able to use this plugin for what you need you have to write a SQL query which returns a 2 columns table like this

    Blue 5
    Red 2
    Yellow 3

    I think this is feasible using count()

    cheers,
    Claudio

Viewing 1 replies (of 1 total)
  • The topic ‘Can you sum up table fields with one query?’ is closed to new replies.