# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
cancel
Showing results for
Did you mean:
Contributor II

## Aggr in set analysis

Hi all,

I have this SQL expression :

``````SELECT COUNT(id_fich_prjt) FROM
(
SELECT id_fich_prjt,SUM(mt_prvs) AS dep_prev
FROM DTM_PROJET.dm_sicl_suivi_depenses_ae_cp
GROUP BY id_fich_prjt
) as Toto
where dep_prev>=500000
``````

Result = 388

I tried to transform this expression in Qlik sense with set analysis :

``````COUNT({< [mt_prvs] = {"=Aggr(SUM([mt_prvs]), [id_fich_prjt])>=500000"} >}
[id_fich_prjt])
``````

Result = 2060

Where is the problem in my AGGR function ?

Thanks

Labels (3)

• ### Set Analysis

1 Solution

Accepted Solutions
Champion III

Just this is sufficient

Count({<[id_fich_prjt]={"=sum([mt_prvs])>=5000"}>}[id_fich_prjt])

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
4 Replies
Specialist III

Hello,

Try with :

``=count(if(aggr(sum(mt_prvs),Id_fich_prjt)>500000,Id_fich_prjt))``

Champion III

Just this is sufficient

Count({<[id_fich_prjt]={"=sum([mt_prvs])>=5000"}>}[id_fich_prjt])

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Contributor II
Author

Hi,

Thanks @sergio0592 and @vinieme12 . Both solutions work but the last one use set analysis.

Thanks again.

Champion III