Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Percentage of total

I wish to create a field which calculates % of total sales.

The below formula is what i use to produce the sales figure.

count(aggr(min(Premium),RiskNo))

The above formula workls perfectly. But i want to get the total of the 'sales' column and use it to get a % per  individual row (see below)

count(aggr(min(Premium),RiskNo)) / Total(count(aggr(min(Premium),RiskNo))

is there such a finction as the total i used above? could somebody suggest an alternitive?

Much Pppreciated

J

1 Reply
swuehl
MVP
MVP

I am absolutely unsure what you want to calculate. You are calculating the minimum value in field Premium per RiskNo, but then just count the number of returned values, this is giving your sales figure?

Could you maybe post some lines of sample data together with your expected outcome?

There is indeed a total keyword, you can use TOTAL qualifer inside a chart aggregation function like count(total value) or count(total<Dimension> value). From the Help:

The total qualifier may be followed by a list of one or more field names within angle brackets. These field names should be a subset of the chart dimensions. In this case the calculation will be made disregarding all chart dimensions except those listed, i.e. one value will be returned for each combination of field values in the listed dimension fields. Also fields which are not currently a dimension in a chart may be included in the list. This may be useful in the case of group dimensions, where the dimension fields are not fixed. Listing all of the dimensions in the group causes the function to work when the cycle or drill-down level changes.

What is the context of your above expression? Where do you use it, what are the dimensions used?

Regards,

Stefan