Qlik Community

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 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

Percentage calculation Help

Hi Experts,

Can any one please help me on below issue.

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

Please help me on this.

Thanks in advance

1 Solution

Accepted Solutions
Highlighted
Creator III
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]))

View solution in original post

3 Replies
Highlighted
Specialist III
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
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
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]))

View solution in original post