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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
p_verkooijen
Partner - Specialist II
Partner - Specialist II

aggr overrides set analysis

I've got a aggregation which display's what location/week combinaties are valid to compare.

However when I select a location only these locations remain in the output. I can't apply Set Analysis on the AGGR.

I want all locations because of benchmark purposes.

see attachtment

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try:

=CONCAT({1}DISTINCT

  AGGR(

  IF(

  (

  FABS(

  (SUM({1<Sales_Year={2013}>} total <Location, Sales_Week> SalesRow_Total_Realized) - SUM({1<Sales_Year={2012}>} total <Location, Sales_Week> SalesRow_Total_Realized))

  / SUM({1<Sales_Year={2012}>} total <Location, Sales_Week> SalesRow_Total_Realized)

  )

  <= 0.75

  )

  , only({1}Location&'|'&Sales_Week)

  )

  ,  Location, Sales_Week)

, CHR(10) )


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try:

=CONCAT({1}DISTINCT

  AGGR(

  IF(

  (

  FABS(

  (SUM({1<Sales_Year={2013}>} total <Location, Sales_Week> SalesRow_Total_Realized) - SUM({1<Sales_Year={2012}>} total <Location, Sales_Week> SalesRow_Total_Realized))

  / SUM({1<Sales_Year={2012}>} total <Location, Sales_Week> SalesRow_Total_Realized)

  )

  <= 0.75

  )

  , only({1}Location&'|'&Sales_Week)

  )

  ,  Location, Sales_Week)

, CHR(10) )


talk is cheap, supply exceeds demand
p_verkooijen
Partner - Specialist II
Partner - Specialist II
Author

Hi Gysbert,

Thanks, I did find the ONLY({1} in some discussions but couldn't get it to work.

Can you explain the use of ONLY ?

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

The only function is the standard aggregation function. It returns a value when there is only one value, otherwise it returns null. In your if statement you had such an implicit use of the only aggregation function: Location&'|'&Sales_Week. I made it explicit and added the set modifier {1} to it to get the result you wanted.


talk is cheap, supply exceeds demand