Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

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

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

7 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Rhea

Hard to answer these questions without more information about your data structure, but perhaps the answer to you first question is something like:

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

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

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

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! 🙂

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

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

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Thank you very much Kaushik. It solved my problem. 🙂

Not applicable
Author

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.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

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

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!