Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Aggr in Adhoc Report

Hi  ,

i am facing an issue , i was not getting the correct sum in expression so i used aggr in expression in Adhoc report . but i have 45 dimensions in adhoc report so dont want to write all the dimensions in the aggr.

so  i tried like

=sum(aggr(Count(Distinct [Customer Customer_code]),concat(AdHocTotalCustomer_DimensionTree,',')))

or

=sum(aggr(Count(Distinct [Customer Customer_code]),GetFieldSelections(AdHocTotalCustomer_DimensionTree))).

These  expression did not work for me .  Kindly suggest something.

Thanks!!!

5 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi Saurabh,

Try like this

Create a variable

vSelectedDim ::: =GetFieldSelections(AdHocTotalCustomer_DimensionTree)

and use expression

=sum(aggr(Count(Distinct [Customer Customer_code]), $(vSelectedDim)))

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

Hi Jagan

Thanks for reply .

i tried the same . its not working.

Regards,

Saurabh

jagan
Luminary Alumni
Luminary Alumni

Hi,

I checked this in the sample attached in the below link, it is working

Adhoc reporting in Qlikview


Did you given = in variable declaration?


Regards,

Jagan.

Not applicable
Author

Yes .

i used below mentioned variable & expression. but it did work .

vSelectedDim

=GetFieldSelections(AdHocTotalCustomer_DimensionTree)

Expression

=sum(aggr(Count(Distinct [Customer Customer_code]), $(vSelectedDim)))

Thanks!!

jagan
Luminary Alumni
Luminary Alumni

Hi Saurabh,

I am not sure about why it is not working, you have any spaces or special characters in field values?  If possible attach sample file.

Regards,

Jagan.