Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
gisellevaleta
Contributor III
Contributor III

Aggr

Hi All

I have a TY and LY expression that returns the correct value 

TY: If((Avg({<[SK Ldow No]={"$(=Max([SK Ldow No]))"}>}([Binc Previous RSP]-[Binc Current RSP])))>0,
        (Sum({<[SK Ldow No]={"$(=Max([SK Ldow No]))"}>}([Cls Stk Qty]+[In Trnst Qty]))),0) = 7 697 656

LY: If((Avg({<$(vClearDates), [SK Ldow No]={"$(=Max([SK Pyr Ldow No]))"}>}([Binc Previous RSP]-[Binc Current RSP])))>0,
      (Sum({<$(vClearDates), [SK Ldow No]={"$(=Max([SK Pyr Ldow No]))"}>}([Cls Stk Qty]+[In Trnst Qty]))),0) = 7 123 552

When I apply the Aggr function only my TY returns the correct value, my LY is incorrect. What am i doing wrong in my LY Aggr expression?

TY: Sum(Aggr((If((Avg({<[SK Ldow No]={"$(=Max([SK Ldow No]))"}>}([Binc Previous RSP]-[Binc Current RSP])))>0,
       (Sum({<[SK Ldow No]={"$(=Max([SK Ldow No]))"}>}([Cls Stk Qty]+[In Trnst Qty]))),0)), Subclass, Style, SKU)) = 7 697               656

LY: Sum(Aggr((If((Avg({<$(vClearDates), [SK Ldow No]={"$(=Max([SK Pyr Ldow No]))"}>}([Binc Previous RSP]-[Binc                Current RSP])))>0,
      (Sum({<$(vClearDates), [SK Ldow No]={"$(=Max([SK Pyr Ldow No]))"}>}([Cls Stk Qty]+[In Trnst Qty]))),0)), Subclass,          Style, SKU)) = 6 209 187

0 Replies