Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hello everyone,
i have a query regarding creation of pie chart. In my 'sales_details' database there are 4 fields namely 'item_net_amount', 'item_total', 'sale_stcst_amt', and 'sale_schem_amt' . i want to show all these in pie chart for a particular product.
The problem is that in pie chart atmost 2 attributes can be taken.so how can i plot all the 4 attributes .
thanks & regards
anish
Hi
Do you have any negative values in your data?
Can you post an example of the QVW?
I think you can have one active expression at a time in pie chart. Moreover, you can create multiple expressions and group them..not sure what you mean by atmost 2 attributes..
Thanks
Amit
thanks amit,
according to you, i will have to create 4 expressions like sum( item_net_amt), sum(item_total),sum( sale_stcst_amt)......etc
but i m getting problem in this.plz elaborate how will i create multiple exp.
As problem is not cleared to you. i m giving u details. in my sales details table there is relation between all the four attributes as
item_net_amt = item_total + sale_stcst_amt - sale_schem_amt.
for each product sold, i have to show some of amount of each of these entities in a pie chart .
expecting a quick reply
anish
Hi
I figured out a way to do this, example attached.
First, I created some inline data in my load script that I can use as a dimension, this gives me a list of all the "values" I want to show on the pie chart. In the pie chart itself, use this value as the dimension, then as the expression (as you can see from the example) just do a standard IF...THEN...IF....THEN statement to show the value you want.
I also then included a list box for Product next to the pie chart so you can select the product you want.
Let me know if it works for you (ignore the numbers in this example, they're not supposed to make any sense).
tanx for ur response nigel,
but i m unable to open ur document as i m using personal edition 9.is there any other way to get that?.
Hi
In that case, let's try to give you the instructions step by step so you can re-produce them in your version.
Step 1: Add some inline data to your load script.
I have added
ValueFields:
LOAD * INLINE
[ValueType
Sales
Price
Quantity
YTD];
Note that in the above example, you should replace these with the value types you want to show, preferably in user recognisable wording
Step 2: Refresh your QVW
Step 3: Create your bar chart
Add the field name ValueType as your dimension
Add the following as your expression (obviously wording and field names will change according to your own values):
=IF(ValueType='Sales',Sum(Sales),IF(ValueType='Price',Sum(Price),IF(ValueType='Quantity',Sum(Quantity),Sum(YTD))))
Step 4: Create a list box
The list box is simply your product field that you want to analyse values for, but I'm sure you can work that one out.
That's it,
hello nigel,
as suggested by you i have added inline data to load script but still have some problem. the pie chart shows a message " no data to display" . its not generating any error on reload or debug. in table viewer inline table is shown explicitly and is not attached with any other table via any field because key field is not included in inline declaration.
Hi
Do you have any negative values in your data?
Can you post an example of the QVW?
hi,
there is no negative value in my data.i think problem is with nested if condition because its showing 'error in expression' on the top of edit expression editor.
Hi,
problem solved . thanks to u nigel . since it was odbc connection so every field has to be placed within "" while using sum function.
but i still have some problem, on mouse hover i want to show sum of each of the fields while in title of the chart the aggr. sum of all fields. currently its showing the whole nested if expression on mouse hover.
any suggestion would be appreciated...