# Qlik Sense App Development

Not applicable

## can anyone write in Setanalysis

count(if(AgentOrDist='A',AgentID))/count(TOTAL <[Zone],[Region],[Cluster],[JC]> if(AgentOrDist='A',AgentID))

Hello everyone ,

Help me write in setanalysis,

1 Solution

Accepted Solutions
Contributor II

## Re: can anyone write in Setanalysis

Try This:

=count({<AgentOrDist={'A'}>}AgentID)/count(TOTAL <[Zone],[Region],[Cluster],[JC]> {<AgentOrDist={'A'}>}AgentID)

4 Replies
Contributor II

## Re: can anyone write in Setanalysis

Try This:

=count({<AgentOrDist={'A'}>}AgentID)/count(TOTAL <[Zone],[Region],[Cluster],[JC]> {<AgentOrDist={'A'}>}AgentID)

Not applicable

## Re: can anyone write in Setanalysis

Anychance we can right this in setanalysis

if(vJCFactor=1,

COUNT(DISTINCT IF(aggr((sum(if(TranDt>=\$(vFromDate) AND TranTyp='CO',TranAmt))/SUM(AGGR(if(DsbrDate>=\$(vFromDate) and DsbrDate<=Today

AND DsbrDate >= MonthStart(min(TranDt)) and DsbrDate <= MonthEnd(max(TranDt)), SUM(DisbrAmt)),DsbrDate,JC))),JC)>=.5,JC)),

if(vJCFactor=2,

COUNT(DISTINCT IF(aggr

(SUM(if(TranTyp='CB' AND TranDt>=\$(vFromDate), TranAmt))/

SUM(AGGR(if(DemandDate>=\$(vFromDate) and DemandDate<=Today

AND DemandDate >= MonthStart(min(TranDt)) and DemandDate <= MonthEnd(max(TranDt)), SUM(DemandAmt)),DemandDate,JC)),JC)

>=.75,JC)),

if(vJCFactor=3,

COUNT(DISTINCT IF(aggr(count(DISTINCT if(\$(AgntMonthlyComm)>=2500 AND AgentOrDist='A',AgentID))

/count(DISTINCT if(AgentOrDist='A',AgentID)),JC)>=.4,JC)),

if(vJCFactor=4,

COUNT(DISTINCT IF(aggr(sum(if(TranDt>=\$(vFromDate) AND TranTyp='DR',TranAmt))/\$(vTotalTranAmt),JC)>=.2,JC)),

COUNT(DISTINCT IF(aggr(COUNT(DISTINCT IF(Status='A' and AgentOrDist= 'A',AgentID))

/COUNT(DISTINCT IF(AgentOrDist= 'A',AgentID)),JC)>=.5,JC))))))

Contributor III

## Re: can anyone write in Setanalysis

Hi Charlie,

Try:

if( AgentOrDist = 'A', count(AgentID)/Count(Total <[Zone],[Region],[Cluster],[JC]> AgentID))

or

count({<AgentOrDist = {'A'}>}AgentID)/count(Total <[Zone],[Region],[Cluster],[JC]> {<AgentOrDist = {'A'}>}AgentID)

Hope it helps,

Carlos M

Not applicable