Re-use table data into bar chart?

Hi everyone,

I'd like to know whether it is possible to reuse the values of a table as input to draw a bar char?

For example I get the following tuples from a dataset "SELECT * FROM User":

User id Favorite fruit Age
1 Apple 36
2 Apple 14
3 Banana 56
4 Apple 51

I use the "table" widget to get

  AVG(age)
Apple 33,7
Banana 56

And I'd like to draw it this way

 table

Can I reuse the table data or should I change my dataset ?

Obviously, this is a huge simplification of what I need to do to make it understadable... The point is, I have to perform difficult crosstab calculations on a complex dataset query and draw them into a graph and it would same me a huge amount of time and headaches to use the capabilities of crosstab widget instead of writing them myself in SQL.

 

Thank you for your help!

 

etienne.girot's picture
Joined: Jan 7 2014 - 12:10am
Last seen: 8 years 11 months ago

1 Answer:

Sure you can create a sub-dataset and attach it to both the table and the chart - I think the query will only run once

ernestoo's picture
18960
Joined: Nov 29 2010 - 11:59am
Last seen: 6 years 14 min ago

As mentioned, the example above is a simplification, actually it is really difficult for me to obtain the 2nd table as a SQL query (which I think you would consider to be the sub-dataset). On the other side, the crosstab does it really easily, that's why I would like to use the crosstab output as input for a bar chart. Is it possible?

etienne.girot - 8 years 11 months ago

ah ok - if that's the case unfortunately the answer is no - I don't think you can export the totals into variables either...I am not 100% sure about this answer!

ernestoo - 8 years 11 months ago
Feedback
randomness