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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
jim_chan
Specialist
Specialist

How to calculate sales and bring forward some dates sales to next month?

Hi guys,

I need to create a monthly Sales  expression.

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 a sample attached here.

Rgds,

Jim

10 Replies
its_anandrjs
Champion III
Champion III

What is expected out put provide need to check the solution

This month sale

=sum( {<Sales_Date = {"$(=Date(Max(Sales_Date)))"} >} Sales)


Next Month Sale

=sum( {<Sales_Date = {"$(=Date(Max(Sales_Date)-1))"} >} Sales)


qliksus
Specialist II
Specialist II

Maybe something like the below

sum(Sales) +  rangesum(above(sum({<[Good Issue Dates]={"=day([Good Issue Dates])>=28 and day([Good Issue Dates])<=31"},Sales_Cat={'M','I'}>} Sales)),0)

jim_chan
Specialist
Specialist
Author

Thanks kumar, did you edit the attachment i sent to you?? Can you attach here?

Rgds

Jim

techvarun
Specialist II
Specialist II

Capture.PNG

Try the attached

qliksus
Specialist II
Specialist II

Just add the below  expression in the chart with month as dimension

sum(Sales) +  rangesum(above(sum({<[Good Issue Dates]={"=day([Good Issue Dates])>=28 and day([Good Issue Dates])<=31"},Sales_Cat={'M','I'}>} Sales)),0)

Cant attach anything dude its restricted in my environment

jim_chan
Specialist
Specialist
Author

Dear Kumar,

I Have to add in the loading script, bro. is part of the requirement to create a Sales Volume KPI.

Meaning, this is part of the requirement, so have to create it in the loading script. - For instance the sum field is Sales.

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

else 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

jim_chan
Specialist
Specialist
Author

Thanks Varun!

jim_chan
Specialist
Specialist
Author

Thanks Varun.

What if i need to create in the loading script?

I Have to add in the loading script, bro. is part of the requirement to create a Sales Volume KPI.

Meaning, this is part of the requirement, so have to create it in the loading script. - For instance the sum field is Sales.

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

else 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

techvarun
Specialist II
Specialist II

Hi Jim

Can you share the expected numbers by month?

also state what is the issue in the qvw I have attached.