Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

ankit28287
New Contributor III

Set analysis with Aggr Function

hi guys,

               i have one issue in using set analysis -

                    =Sum({$<Year = >} aggr(DISTINCT(Value),%Key))

               i want all Year, so want to exclude any year selection and aggr distinct function too..

               in dimension i am using month and FY.

               % Key is combination of Territory and Dates.

               this code is not working for me...please if anyone can solve it....

               please check attachment for more details.

1 Solution

Accepted Solutions
sergey_maka8
Valued Contributor

Re: Set analysis with Aggr Function

Try

Sum({$<Territory={"*"}-{'Global'},Year = >} aggr(DISTINCT(Sum({$<Year>}Value)),%Key))

and

Sum({$<Year = >} aggr(DISTINCT(Sum({$<Year = >}Value)),%Key))

in AGGR you need to use an aggregation function like Sum or Only or Count etc...

and in this case you can use set analysis before agregation

PFA

1 Reply
sergey_maka8
Valued Contributor

Re: Set analysis with Aggr Function

Try

Sum({$<Territory={"*"}-{'Global'},Year = >} aggr(DISTINCT(Sum({$<Year>}Value)),%Key))

and

Sum({$<Year = >} aggr(DISTINCT(Sum({$<Year = >}Value)),%Key))

in AGGR you need to use an aggregation function like Sum or Only or Count etc...

and in this case you can use set analysis before agregation

PFA

Community Browser