Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

tuning of expression

Hi,

Can anyone hepl me in tuning of below expression:

=sum(aggr(round(sum({$<Store_fiscal=(P({<status_comp={Current}>})),status_comp={Current},

STORE_NUMBER-={'0099'},status={Current}>}

if(Coupon_Flag='Y' and (ACCT='MHOODC' or ACCT='QOP.C' or ACCT='MHOOD.') ,

aggr(sum(Sold_At*Qty*conv_rate),Order_Key)-Coupon_Dollars,

if(Coupon_Flag='Y' and (  ACCT<>'QOP.C' or ACCT<>'MHOODC' or ACCT<>'MHOOD.' ) ,

aggr(sum(Sold_At*Qty),Order_Key)-Coupon_Dollars,

  if(Coupon_Flag<>'Y' and (   ACCT='QOP.C' or ACCT='MHOODC' or ACCT='MHOOD.'),

(Sold_At*Qty*conv_rate),

(Sold_At*Qty))))),1),Shipping_Date,STORE_NUMBER))

Is there a way to avoid If's.Pls suggest

Thanks,

Swetha

1 Reply
fernandotoledo
Partner - Specialist
Partner - Specialist

First of all, what does this expression do?

Do you want to sum the field Qty*Sold_At and apply a conv_rate then remove Coupon_Dollars in some special cases?

I didn't understand what you want with all that AGGR and SETS, but as far as I got it, the expression should be something like this:

sum(

{$<STORE_NUMBER-={'0099'}>}

Sold_At*Qty

*

if((ACCT='MHOODC' or ACCT='QOP.C' or ACCT='MHOOD.'),conv_rate,1)

-

if(Coupon_Flag='Y',Coupon_Dollars,0)

)