Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

{<FIELD=>} not working in AGGR() function

Hello,

I am using count of FIELD1 across dimension FIELD and using AGGR() to do group by of FIELD2,FIELD3,FIELD4 in a chart. Also i have used {<FIELD=>} as the set modifier so that the selection in FIELD should not reflect in chart. The chart is working unless i don't make a selection in FIELD. As soon as selection is done in FIELD, the chart changes according to the selection thus ignoring the set modifier {<FIELD=>}.

Can someone explain the reason of this different behaviour.

Expression - count({<FIELD=>} AGGR(FIELD1,FIELD2,FIELD3,FIELD4))

Also AGGR(count({<FIELD=>} FIELD1),FIELD2,FIELD3,FIELD4) is not fetching any result, so i used the above expression.

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

SUM({<FIELD = >}Aggr(COUNT({<FIELD = >}FIELD1),FIELD2, FIELD3, FIELD4))

View solution in original post

10 Replies
Gysbert_Wassenaar

Why are you using the aggr function? What are you trying to calculate?


talk is cheap, supply exceeds demand
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Sum({<FIELD=>} AGGR(count(FIELD1),FIELD2,FIELD3,FIELD4) )


Hope this helps you.


Regards,

Jagan.

MK_QSL
MVP
MVP

Looking wrong !

count({<FIELD=>} AGGR(FIELD1,FIELD2,FIELD3,FIELD4))


What you are Counting?


Can you provide sample app or data?

swuehl
MVP
MVP

If you want to ignore the selection in FIELD, you should consider using a set expression in the inner as well as the outer aggregation.

count({<FIELD=>} AGGR( only({<FIELD=>} FIELD1), FIELD2,FIELD3,FIELD4))

I am not sure if using only() is what you really want here, but it exactely the same inner aggregation you are using in your original (working without selections) expression.

If you want more help, post more details about the context.

Not applicable
Author

its actually counting FIELD1 and then aggregating on FIELD2, FIELD3,FIELD4

Not applicable
Author

Thanks Jagan!

Unfortunately, this expression also is not preventing the expression to change it's value on selection of FIELD.

Can you come up with some other alternate solution.

Not applicable
Author

Gysbert,

i am calculating count of FIELD1 and aggregating on FIELD2, FIELD3.... while keeping the value of FIELD constant.

MK_QSL
MVP
MVP

SUM({<FIELD = >}Aggr(COUNT({<FIELD = >}FIELD1),FIELD2, FIELD3, FIELD4))

Not applicable
Author

Thanks a ton Manish!

It worked.

thank you so much.