Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

pallabi_jor
New Contributor

How to write aggr function using conditions?

Hi  All,

I need to  write aggregation of  count of project basesd on productId  along with two sum conditions, But I am getting result 0, which is  not correct. Could you please help me to write the code

 

equation:

Count( distinct if(Aggr(Sum({<ItemID={'1','3'}>} Price)>'0' and Sum({<ItemID={'115','120','130'}>} price)='0',ProjectId), ProjectId))

2 Replies
Highlighted
ChennaiahNallani
Contributor III

Re: How to write aggr function using conditions?

ItemId is string or number??

remove single quotes and try

andrey_krylov
Valued Contributor

Re: How to write aggr function using conditions?

Try this

=Sum(Aggr(if(Sum({<ItemID={'1','3'}>} Price)>0 and Sum({<ItemID={'115','120','130'}>} price)=0, 1, 0), ProjectId))