Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Fab93
Contributor II
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)
1 Solution

Accepted Solutions
vinieme12
Champion III
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.

View solution in original post

4 Replies
sergio0592
Specialist III
Specialist III

Hello,

Try with :

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

 

vinieme12
Champion III
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.
Fab93
Contributor II
Contributor II
Author

Hi,

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

Thanks again.

 

vinieme12
Champion III
Champion III

You can read more here

https://community.qlik.com/t5/Qlik-Design-Blog/The-Expression-Search/ba-p/1463907

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