Discussion board where members can get started with Qlik Sense.
I want the correct expression containing the AGGR Function for the given query.
Tried a few things but it didn't work out.
I'm posting the example below.
Sum[Count( Distinct (mobilecode))/Count(Distinct (routecode))]
Where mobilecode and routecode are field names.
Thanks In Advance.
SUM(Aggr(COUNT(Distinct mobilecode)/COUNT(Distinct routecode),YourDimensionField1,YourDimensionField2))
Avg(Aggr(COUNT(Distinct mobilecode)/COUNT(Distinct routecode),YourDimensionField1,YourDimensionField2))
Normally an expression like this would be the right one:
Sum( Aggr( Count(DISTINCT mobilecode) / Count(DISTINCT routecode) , <DIM1> [, <DIM2 , ... ]) )
<DIM1> is a field that is the first grouping level.
[<DIM2>, ....] is an optional list of one or more grouping levels you need or want.
Whether this will work in the context you intend to use it is hard for me to say.
The thing that Aggr introduce is that you aggregate over one or more dimension....
So it is a grouping level you have to select for the Aggr function to work. The result of an Aggr might be 0 or more values. That's why you have to do an aggregation afterwards to be sure that you can display or present the results of the Aggr.
Sum(aggr(Count( Distinct (mobilecode))/Count(Distinct (routecode)), Dim1, Dim2))
whereby Dim1, Dim2 are the dimensions in your chart respectively those dimensions against the calculation should be run.