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: 
jim_chan
Specialist
Specialist

how to write this in loading Script: How to calculate sales and bring forward some dates sales to next month?

Hi guys,

The requirement here is:

Sales ID with Good Issue dates that fall on 28,29,30,31 and Sales_cat = M, I . will be added in to Next Month Sales. I Have to create it in the loading script, part of the requirement is to create a Sales Volume KPI. IT's a Sales Volume KPI as at Yesterday.

For instance the sum field is Sales.

if(Good Issue Date = 28,29,30,31, Sales Cat = M,I , then bring forward the sales to NEXT MONTH SALES, then sum(Sales)

else sum(Sales)) as Sales_Volume_KPI .

Logic is like that, but i dont know how to convert it into a workable script.

Can help guys?

Rgds

Jim

2 Replies
Anil_Babu_Samineni

Can we know the reason behind do it in back-end

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
prieper
Master II
Master II

What, if you use a different calendar:

IF(DAY(Good_Issue_Date) >= 28 AND DAY(Good_Issue_Date) <=31, MONTHSTART(Good_Issue_Date +4), Good_Issue_Date)          AS Sales_Month

?