Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to create a calculation that gives me this year % of business. How would I do that using the example below:
| Brand | Customer | $ Amount | % of Business |
| XYZ | Customer A | 50 | 0.31 |
| XYZ | Customer B | 25 | 0.16 |
| XYZ | Customer C | 35 | 0.22 |
| XYZ | Customer D | 50 | 0.31 |
| Sum XYZ | 160 |
I'm trying to figure out how to use an expression to calculate the last column. It has to be able to be dynamic based on the date/year selected.
Thanks!
Try This:
Sum(Amount) / sum(Total <Brand> Amount)
Mike.
Well, the way QlikView works will dynamically reduce results automatically. So I would say just do a sum of the [% of Business] field. You probably also want to load that field in your script using GROUP BY Brand.
Regards,
If it is an Straight Table, you can just check the 'Relative' option in the Expressions tab (Maybe after you've duplicated the first Expression).
If the Relative checkbox is not available, you can add an expression like
Sum(Amount) / sum (TOTAL Amount)
HTH.
^^
How good is the relative feature? love it.
Thank you. I think it's a little more difficult. I should provide more detail. I'm trying to find the percent based on the brand. For example, in the chart below I want to see the percent of XYZ business that customer A has, and also the percent of ABC business, etc. Not just a percent of the total business.
| Brand Flag | Division | GSV | Percent |
| XYZ | Customer A | 50 | 28.57% |
| XYZ | Customer B | 100 | 57.14% |
| XYZ | Customer C | 25 | 14.29% |
| ABC | Customer A | 200 | 71.43% |
| ABC | Customer B | 55 | 19.64% |
| ABC | Customer C | 25 | 8.93% |
| DEF | Customer A | 100 | 40.00% |
| DEF | Customer B | 50 | 20.00% |
| DEF | Customer C | 100 | 40.00% |
Try This:
Sum(Amount) / sum(Total <Brand> Amount)
Mike.