Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Read about the latest Qlik Community enhancements on the Community News blog!
cancel
Showing results for 
Search instead for 
Did you mean: 
praveensp
Contributor
Contributor

need quick help with set analysis

Hi Guys,

I need help in applying set analysis.

I have to do calculation of percentage. I have already applied a set analysis for denominator. I need to again apply a set analysis for the whole calculation i.e., numerator and denominator both. Kindly help me to resolve this problem.

Below is my formula -

=count(proficy_ptn) / Count({$<[Motor Group]={TM1},[WAG]={WAG2}>}[Motor Group])+count({$<[Motor Group]={TM2},[WAG]={WAG2}>}[Motor Group])+Count({$<[Motor Group]={TM1},[WAG]={WAG1}>}[Motor Group])+count({$<[Motor Group]={TM2},[WAG]={WAG1}>}[Motor Group])

On top of this calculation i need to apply set analysis = {<[motor_type]={AC},[Motor Group]={TM1,TM2},[WAG]={WAG1,WAG2}>}

 

Waiting for your replies.

 

Regards,

Praveen Prabhu 

 

 

Labels (1)
8 Replies
shiveshsingh
Master
Master

Hi

You can store this expression in a variable and then use set analysis.

or May be this can help..

 

sum({<[motor_type]={AC},[Motor Group]={TM1,TM2},[WAG]={WAG1,WAG2}>}
count(proficy_ptn)
/
Count({$<[Motor Group]={TM1},[WAG]={WAG2}>}[Motor Group])+count({$<[Motor Group]={TM2},[WAG]={WAG2}>}[Motor Group])+Count({$<[Motor Group]={TM1},[WAG]={WAG1}>}[Motor Group])+count({$<[Motor Group]={TM2},[WAG]={WAG1}>}[Motor Group]))

praveensp
Contributor
Contributor
Author

Nope, this solution is not working.. Any other solution?
praveensp
Contributor
Contributor
Author

Says nested aggregation not allowed.
shiveshsingh
Master
Master

My bad, it will not work ..
Try storing the data in variable and then use set analysis...
praveensp
Contributor
Contributor
Author

What aggregation shall i use after storing it in variable?
achates2008
Contributor III
Contributor III

Try this, a little bit simplified. Not sure if understand your requirement correctly.

besides, those values are not number, so should use single quote.

=count({$<[Motor Group]={'TM1','TM2'},[WAG]={'WAG1','WAG2'}>}proficy_ptn) /
count({$<[Motor Group]={'TM1','TM2'},[WAG]={'WAG1','WAG2'}>}[Motor Group])

shiveshsingh
Master
Master

The same expression that you have shared before.

sunny_talwar

May be this

=Count({<[motor_type] = {AC}, [Motor Group] = {TM1, TM2}, [WAG] = {WAG1, WAG2}>}proficy_ptn)/
(Count({$<[motor_type] = {AC}, [Motor Group] = {TM1, TM2}, [WAG] = {WAG1, WAG2}>}[Motor Group])+
Count({$<[motor_type] = {AC}, [Motor Group] = {TM1, TM2}, [WAG] = {WAG1, WAG2}>}[Motor Group])+
Count({$<[motor_type] = {AC}, [Motor Group] = {TM1, TM2}, [WAG] = {WAG1, WAG2}>}[Motor Group])+
Count({$<[motor_type] = {AC}, [Motor Group] = {TM1, TM2}, [WAG] = {WAG1, WAG2}>}[Motor Group]))

 

Actually, do you mind putting in words as to what exactly are you trying to do here?