7 Replies Latest reply: Apr 5, 2013 1:44 AM by Kaushik Solanki

# Help needed on chart values and expressions

Hi Everyone,

I have a couple of problems that I need your help with:

1. How to show the correct percentage in a bar chart? Say I want to show the % of rounds that were approved to the number of rounds that were created per region. so, if I have this data:

Created   Approved

Region1    100       25

Region2    50        25

Region3    90        80

so, my bar chart should show this:

25%      50%                      88.88%

Region1           Region2           Region3

I tried just putting the Region as dimension and this as my expression: Count(DISTINCT if(COPIED_ROUND_ID<>0 or COPIED_ROUND_ID>0,ROUND_ID))

but the percentage showed are all wrong. It doesn't match up to the expected percentage if I compute it manually.

How do I do this and get the correct data?

2. I need to measure the average scenarios that are created in a round. One round can have one or more scenarios, so I need to get the average scenarios created in a round and display it in a bar chart by Region as well. Should I do this in the dimension/expression of the bar chart or should I do this in my script? Any suggestion how best to do it and the best expression to use?

Any help is greatly appreciated.

Regards,

Rhea

• ###### Re: Help needed on chart values and expressions

Rhea

Count({<Status = {'Approved'}>}  Distinct if(COPIED_ROUND_ID > 0, ROUND_ID)) /

Count({<Status = {'Created'}>} Distinct if(COPIED_ROUND_ID > 0, ROUND_ID))

But this is just a guess

Hope that helps

Jonathan

• ###### Re: Help needed on chart values and expressions

Hi,

If you have data as you are showing.

Then try this expression.

Sum(Approved)/Sum(Created ) and in Number Tab Click on  Show in %.

Your second question is not that clear, will you please explain with example.

Regards,

Kaushik Solanki

• ###### Re: Help needed on chart values and expressions

thank you for the reply Jonathan and Kaushik.

I have created a sample qvw file to explain further.

Kaushik, I'm not sure if I can use sum. Anyway, I would really appreciate if you can take a look at my qvw file.

thanks for all the help guys! :-)

• ###### Re: Help needed on chart values and expressions

Hi,

Have a look at the application attached.

Following changes done,

1. Remove the Relative Check box.

2. changes in expression.

Hope this will sove your problem.

Regards,

Kaushik Solanki

• ###### Re: Help needed on chart values and expressions

Thank you very much Kaushik. It solved my problem. :-)

• ###### Re: Help needed on chart values and expressions

Just a follow-up question. I just noticed, some expressions have an equal (‘=’) sign in front, some do not have. Why is that? What is the difference?

Thanks.

• ###### Re: Help needed on chart values and expressions

Hi,

When you are using the expression in chart, you dont need to specify '=' sign, by default it is their, and even if you use, there will be no difference.

But when you want to use expression in variable or text box then it is required.

Regards,

Kaushik Solanki