Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

RutiTRubin
Contributor

Help with Aggr Function

Hi everyone,

I create Bar Char with dimensions: Region

The measure should be: avg of (Max(to_date)-max(start_date) group by to_category,from_category)

I try the following expression:

Avg(aggr(Max(to_date)-max(start_date)),to_category,from_category))

- But I didn't got any result.

This is strange because when I create a table with the dimensions: Region, from_category, to_category

and the measure : Max(to_date)-max(start_date) with type total - avg.

- I have got a results.


Could you please advise?


Thank you!

7 Replies

Re: Help with Aggr Function

Try to add Region to your Aggr()'s dimension

Avg(Aggr(Max(to_date) - Max(start_date), Region, to_category, from_category))

RutiTRubin
Contributor

Re: Help with Aggr Function

Thank you for your response.

I forgot to mention - I have more alternative dimensions..

Re: Help with Aggr Function

Would you be able to share a sample?

sasiparupudi1
Honored Contributor III

Re: Help with Aggr Function

Avg(Aggr(Max(to_date) - Max(start_date), Region, to_category, from_category,alternative dim1,alternative dim2..))

RutiTRubin
Contributor

Re: Help with Aggr Function

Thank you for your response-

It's bring different results when you grouped by more dimensions.

For example :

I want that when the user Choose dimension Region the calculate wil be:

Avg(Aggr(Max(to_date) - Max(start_date), Region, to_category, from_category)


when the user Choose dimension Geography the calculate wil be:


Avg(Aggr(Max(to_date) - Max(start_date), Gegraphy, to_category, from_category)



Re: Help with Aggr Function

how are they choosing dimensions? is it from a list of island table entries?

RutiTRubin
Contributor

Re: Help with Aggr Function

I just defined the dimensions as alternative and the following list is appear - The user should pick from the following list:

2018-03-28_12-22-48.png

Community Browser