Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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
Partner - Champion III
Partner - Champion III

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
Partner - Champion III
Partner - Champion III

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
Partner - Champion III
Partner - Champion III

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.