# New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Now
cancel
Showing results for
Did you mean:
Highlighted
Creator III

## Percentage calculation Help

Hi Experts,

Left hand Low% is calculated as like below

=(Count({<[Year]={\$(=Max([Year])-1)},

[Rating]={'Low'}>}distinct [ID]))/

(Count({<[Year]={\$(=Max([Year])-1)},[Rating]={'Low'}>}distinct [ID])+Count({<[Year]={\$(=Max([Year])-1)},[Rating]={'High'}>}distinct [ID])+

Count({<[Year]={\$(=Max([Year])-1)},[Rating]={'Medium'}>}distinct [ID]))

Right hand Low% is calculated as like below

=(Count({<[Year]={\$(=Max([Year])-1)}>}distinct [ID])/(Count({<[Year]={\$(=Max([Year])-1)}>}total distinct [ID])

but both values are not matching

1 Solution

Accepted Solutions
Highlighted
Creator III

## Re: Percentage calculation Help

The below expression is working fine

=(Count({<[Year]={\$(=Max([Year])-1)},

[Rating]={'Low'}>}distinct [ID]))/

(Count({<[Year]={\$(=Max([Year])-1)},[Rating]={'Low'}>}total distinct [ID])+Count({<[Year]={\$(=Max([Year])-1)},[Rating]={'High'}>}total distinct [ID])+

Count({<[Year]={\$(=Max([Year])-1)},[Rating]={'Medium'}>}total distinct [ID]))

3 Replies
Highlighted
Specialist III

## Re: Percentage calculation Help

hello

the expression are not the same

in the 1st, you take only 'low' values as numerator and in the 2nd one, you take all values

try to add the same set analysis in both

Highlighted
Master III

## Re: Percentage calculation Help

May be try

Avg(Aggr((Count({<[Year]={\$(=Max([Year])-1)}>}distinct [ID])/(Count({<[Year]={\$(=Max([Year])-1)}>}total distinct [ID]),

MonthYear)

)

Highlighted
Creator III

## Re: Percentage calculation Help

The below expression is working fine

=(Count({<[Year]={\$(=Max([Year])-1)},

[Rating]={'Low'}>}distinct [ID]))/

(Count({<[Year]={\$(=Max([Year])-1)},[Rating]={'Low'}>}total distinct [ID])+Count({<[Year]={\$(=Max([Year])-1)},[Rating]={'High'}>}total distinct [ID])+

Count({<[Year]={\$(=Max([Year])-1)},[Rating]={'Medium'}>}total distinct [ID]))