Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
thnkgreen
Contributor

Total Percentages

Hello my fellow QlikView friends.  I am trying to understand what QlikView does when it totals percentages.  As an example, see the example below.  I have a table that looks like this:

Count % (Daily)

0.0%

0.0%

0.0%

0.0%

-

0.0%

0.0%

0.0%

0.0%

0.0%

-6.5%

0.0%

0.7%

0.5%

-1.0%

-0.8%

-0.6%

-3.0%

-2.4%

-0.2%

-1.1%

-1.9%

36.5%

0.0%


which QlikView totals as 0.0%


so what exactly is QLikView doing to get that total value of 0.0%?  Thanks

1 Solution

Accepted Solutions
Employee
Employee

Re: Total Percentages

By default, QlikView does not sum the values of the lines. And it shouldn't either.

Instead, it calculates the expression over the entire data set. This makes a great difference when calculating ratios, as you do here. Let's say that you want to calculate

   Sum( A ) / Sum( B )

and format this as a percentage. Then the most logical thing to do on the "Totals" line, is to calculate the same ratio but for the entire scope. Summing a number of percentages usually does not make sense.

That the total here is 0.0% does not need to strange. It could be that it is 0% for almost all data, and the numbers, e.g. 36.5%, could represent a very small fraction of the entire scope.

HIC

9 Replies

Re: Total Percentages

It would depend on the expression you are using. Can you share your expression?

MVP
MVP

Re: Total Percentages

In actual, it could be 0.000005% also and because you are showing only one decimal it is shown as 0.0%

Employee
Employee

Re: Total Percentages

By default, QlikView does not sum the values of the lines. And it shouldn't either.

Instead, it calculates the expression over the entire data set. This makes a great difference when calculating ratios, as you do here. Let's say that you want to calculate

   Sum( A ) / Sum( B )

and format this as a percentage. Then the most logical thing to do on the "Totals" line, is to calculate the same ratio but for the entire scope. Summing a number of percentages usually does not make sense.

That the total here is 0.0% does not need to strange. It could be that it is 0% for almost all data, and the numbers, e.g. 36.5%, could represent a very small fraction of the entire scope.

HIC

thnkgreen
Contributor

Re: Total Percentages

Thank you for the reply.  My expression is basically

(COUNT(Today.IDNumber)-COUNT(Yesterday.IDNumber))/COUNT(Yesterday.IDNumber)

thnkgreen
Contributor

Re: Total Percentages

Thank you Henric.  That makes sense

thnkgreen
Contributor

Re: Total Percentages

I am trying to replicate this in Excel.  Any thoughts?  Is it even possible in Excel?

thnkgreen
Contributor

Re: Total Percentages

Count (Daily) = Today (Count) - Yesterday (Count)

Count % (Daily) = Today (Count) - Yesterday (Count) / Yesterday (Count)

Capture.JPG

The 0.0% is what I am trying to replicate in Excel

thnkgreen
Contributor

Re: Total Percentages

Here are the numbers behind the percentages

Capture.JPG

thnkgreen
Contributor

Re: Total Percentages

After reading and re-reading your comments, I decided to apply the same formula


Count % (Daily) = Today (Count) - Yesterday (Count) / Yesterday (Count)


to the totals row instead of simply summing, as you suggested.  It works.  Thank you



Community Browser