Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Based on a simple table like this:
Year, Value1, Value2
2010, 1, 4
2011, 2, 5
2012, 3, 6
Is it possible to create a pie chart that shows the relationship between value1 and value2 for a year, and then cycle the years with a cyclic group? I guess the first question is if it is possible to use cyclic groups for rows rather than columns.
If I transpose the table I can create the cyclic group, but then how do I write the expression to show the both values (now rows) in the pie chart?
All replies are appreciated!
Hmm, I guess I did forget. Attached now.
You can use an expression group if you create three expressions, one for each year. But why not add the Year field to a listbox and let users select the year in there. You could set the listbox to Always One Selected Value so that a user can select only one year at a time.
Thank you for your rapid reply.
The listbox would take up more space (tight design), but I can make it work. I tried it, but can't seem to get the expression right. Could you please show me how to do it? Also, it would be very interesting to see an example of your expression group solution .
I have attached a test document.
See attached example. And if you think a listbox is taking up too much space then get rid of the pie charts and use for example bar charts or inline charts in a straigth table that take up far less space.
If I understand you right you want to have a pie chart showing the ratio of Value1 to Value2 for each year. If so you need to re-organise your data in the load statement like this:
Data:
LOAD * INLINE [
Year, Value1, Value2
2010, 1, 4
2011, 2, 5
2012, 3, 6
];
CrossData:
CrossTable(Dim, Values)
LOAD
*
Resident Data;
Drop table Data;
Turning
Year, Value1, Value2
2010, 1, 4
2011, 2, 5
2012, 3, 6
into
Year | Dim | Values |
---|---|---|
2010 | Value1 | 1 |
2010 | Value2 | 4 |
2011 | Value1 | 2 |
2011 | Value2 | 5 |
2012 | Value1 | 3 |
2012 | Value2 | 6 |
The labels don't make much sense here.
Now you can make your pie chart.
Thank you for the advice. I can't find any examples in your previous post though, did you forget to attach it?
Hi Hakon,
Please find attachment. I hope I've understood what you are wanting, if not let me know.
Cheers
Andrew
Hmm, I guess I did forget. Attached now.
Thank you, great examples!
Thank you for your reply Andrew! Great tip, a crosstable was indeed the solution to my problems (combined with Gysbert's expression groups).