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: 
Surya
Creator II
Creator II

Optimise Code

Dear All,

 

if(RecNo = 1 or PEEK(MATERIAL) = MATERIAL,0,
IF(FREQUENCY_DAYS_MAC = 1,SUM_PROD_QTY_DAILY_MAC,

IF(FREQUENCY_DAYS_MAC = ,SUM_PROD_QTY_DAILY_MAC + PEEK(SUM_PROD_QTY_DAILY_MAC),


IF(FREQUENCY_DAYS_MAC = 3,SUM_PROD_QTY_DAILY_MAC + PEEK(SUM_PROD_QTY_DAILY_MAC)+Peek(PEEK(SUM_PROD_QTY_DAILY_MAC)),


IF(FREQUENCY_DAYS_MAC = 4,SUM_PROD_QTY_DAILY_MAC + PEEK(SUM_PROD_QTY_DAILY_MAC) + Peek(PEEK(SUM_PROD_QTY_DAILY_MAC)) + PEEK(Peek(PEEK(SUM_PROD_QTY_DAILY_MAC))),

IF(FREQUENCY_DAYS_MAC = 5,SUM_PROD_QTY_DAILY_MAC + PEEK(SUM_PROD_QTY_DAILY_MAC) + Peek(PEEK(SUM_PROD_QTY_DAILY_MAC)) + PEEK(Peek(PEEK(SUM_PROD_QTY_DAILY_MAC))) + PEEK(PEEK(Peek(PEEK(SUM_PROD_QTY_DAILY_MAC))))

 

 

Like we need to implement 90 days..Please suggest easiest way to achieve this.

Labels (2)
3 Replies
Anil_Babu_Samineni

I would go with Flags for number of arbitrary ranges on each section.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Surya
Creator II
Creator II
Author

Please give some example..it will help to me.

Anil_Babu_Samineni

Please explain the business logic?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful