
Calculating percentage value in a chart
Jagan Nalla Feb 10, 2012 5:32 AM (in response to rohitsant87)=count({<Date = {">=$(vFromDate) <=$(vToDate)"}>} BookID) / count({<Date = {">=$(vFromDate) <=$(vToDate)"}>} Total BookID)
Check Show in Percent(%) in number tab for the exp

Calculating percentage value in a chart
rohitsant87 Feb 13, 2012 12:20 AM (in response to Jagan Nalla)Hi,
This expression gives me wrong results. I have 36 books of type 'A' and 23 books of type 'B' in the month of Jan 2010. So th total books = 59. So my requirement is that while showing percentage for Jan 2010, it should be based on 59. i.e.type 'A' books = 61.01% and 38.93%. But after implementing the solution given by you, it is giving results as type 'A' books = 27% and type 'B' books = 17% which is wrong.


Calculating percentage value in a chart
Celambarasan Adhimulam Feb 10, 2012 5:38 AM (in response to rohitsant87)Hi,
If you have a field in the name month year then,
Try with this expression,
=Count(Books)/Count(Total <MonthYear> Books)
Check the in percentage option in the number tab of the chart properties.
Hope it helps
Celambarasan

Re: Calculating percentage value in a chart
rohitsant87 Feb 13, 2012 12:22 AM (in response to Celambarasan Adhimulam )Hi,
This expression gives me wrong results. I calculated a field in script as MonthYear = monthname(Date). I have 36 books of type 'A' and 23 books of type 'B' in the month of Jan 2010. So th total books = 59. So my requirement is that while showing percentage for Jan 2010, it should be based on 59. i.e.type 'A' books = 61.01% and 38.93%. But after implementing the solution given by you, it is giving results as type 'A' books = 2% and type 'B' books = 1% which is wrong.


Calculating percentage value in a chart
jagan mohan rao appala Feb 11, 2012 2:46 AM (in response to rohitsant87)Hi,
Try the following expession
=Count({<Date = {">=$(vFromDate) <=$(vToDate)"}>} BookID) /
Count({<Date = {">=$(vFromDate) <=$(vToDate)"}>} Total <MonthYear> Books)
Regards,
Jagan

Re: Calculating percentage value in a chart
rohitsant87 Feb 13, 2012 12:23 AM (in response to jagan mohan rao appala )Hi,
This expression gives me wrong results. I calculated a field in script as MonthYear = monthname(Date). I have 36 books of type 'A' and 23 books of type 'B' in the month of Jan 2010. So th total books = 59. So my requirement is that while showing percentage for Jan 2010, it should be based on 59. i.e.type 'A' books = 61.01% and 38.93%. But after implementing the solution given by you, it is giving results as type 'A' books = 2% and type 'B' books = 1% which is wrong.

Calculating percentage value in a chart
jagan mohan rao appala Feb 13, 2012 12:28 AM (in response to rohitsant87)Hi,
Can you attach the Qlikview file. It would be useful to solve.
Regards,
Jagan.

Re: Calculating percentage value in a chart
jagan mohan rao appala Feb 13, 2012 3:05 AM (in response to rohitsant87)Hi,
Please check the attached file for solution.
Hope this helps you.
Regards,
Jagan.

Temp.qvw 118.5 K

Re: Calculating percentage value in a chart
rohitsant87 Feb 13, 2012 8:50 AM (in response to jagan mohan rao appala )Hi,
I cant attach qlikview file. Also I can't open your file as I have
personnel edition of qlikview.
On Mon, Feb 13, 2012 at 1:35 PM, jagan mohan <

Re: Calculating percentage value in a chart
Celambarasan Adhimulam Feb 13, 2012 9:05 AM (in response to rohitsant87)Hi,
Can you able to attach sample data and image of the chart that shows wrong %?
Celambarasan

Calculating percentage value in a chart
jagan mohan rao appala Feb 13, 2012 9:14 AM (in response to rohitsant87)Hi,
The content in the attached file is
Load Script:
LOAD * INLINE [
MonthYear, BookID, Count
Jan 2010, A, 45
Jan 2010, B, 56
Jan 2010, C, 54
Feb 2010, A, 21
Feb 2010, B, 42
Feb 2010, C, 32
];
In Straight table
I used MonthYear and BookID as dimensions.
Expression : =Sum(Count)/Sum(Total<MonthYear>Count)
Hope this helps you.
Regards,
Jagan.





Calculating percentage value in a chart
Gabriel Vázquez Feb 13, 2012 9:39 AM (in response to rohitsant87)Hello
Not sure I understand, but what would I do (TOTALA) / A and (TOTALB) / B and percentage checkbox
I hope that helps

Re: Calculating percentage value in a chart
rohitsant87 Feb 13, 2012 11:10 PM (in response to Gabriel Vázquez)Hey, my problem got solved. I used divisor as Total BookId.
Thanks all for your help.
2012/2/13 Gabriel Vázquez <qliktech@sgaur.hosted.jivesoftware.com>
**
QlikCommunity <http://community.qlik.com/index.jspa>
Re: Calculating percentage value in a chart
created by Gabriel Vázquez<http://community.qlik.com/people/gabriel.vazquez>in
New to QlikView  View the full discussion<http://community.qlik.com/message/191041#191041>
