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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Consider a particular State with AGGR function

Hi Team,

I am trying to do Comparative Analysis in Qlikview11. I have defined 2 States as StateA and StateB and also have the default State.

I have an Expression which reads something like 

(sum({StateA} SalesValue)

/

  aggr(nodistinct sum({StateA <YearMonth={$(vYearMonthList)}, GlobalProduct=,PPG=,InternalProdct=,BrandEquity=,Manufacturer=,SubBrand=,Variant=,%IntProd=>} SalesValue),  ProductSubCategory,Customer) )*100

My Question is "How can I write to ignore all Selections present for default State. Presently, Imagine I Select Customer1 from default State ListBox and Customer2 from StateA then I get no Results. Only if I manually clear Customer1 from default then I see data coming for the above expression. Can you please tell me EXACT syntax so that only StateA would be considered in my calculations. I guess if it was not for AGGR, it would have worked correctly. Kindly help.

Thanks.

Kuldeep.

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

Try this:

(Sum({StateA} SalesValue)

/

Only({StateA <YearMonth={$(vYearMonthList)}, GlobalProduct=, PPG=, InternalProdct=, BrandEquity=, Manufacturer=, SubBrand=, Variant=, %IntProd=>} Aggr(NODISTINCT Sum({StateA <YearMonth={$(vYearMonthList)}, GlobalProduct=, PPG=, InternalProdct=, BrandEquity=, Manufacturer=, SubBrand=, Variant=, %IntProd=>} SalesValue),  ProductSubCategory,Customer))) * 100

View solution in original post

2 Replies
sunny_talwar
MVP
MVP

Try this:

(Sum({StateA} SalesValue)

/

Only({StateA <YearMonth={$(vYearMonthList)}, GlobalProduct=, PPG=, InternalProdct=, BrandEquity=, Manufacturer=, SubBrand=, Variant=, %IntProd=>} Aggr(NODISTINCT Sum({StateA <YearMonth={$(vYearMonthList)}, GlobalProduct=, PPG=, InternalProdct=, BrandEquity=, Manufacturer=, SubBrand=, Variant=, %IntProd=>} SalesValue),  ProductSubCategory,Customer))) * 100

Anonymous
Not applicable
Author

Thanks Sunny for the help. I was able to get Desired results since now it does not consider other Selections and looks only for StateA. I have shared the output to my User. Will write back if I face any challenge on this question.

Thanks.

Kuldeep.