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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Previous Month Sales in Script

Hi All,

I have an requirement to add Previous Month Sales in the Total Sales . Total Sales is Last Plan Sales +Previous Month Actual Sales . I was calculating all of this in Qlikview Script.  In my table two dates field are present such as Calendar Year ,Calendar-YearMonth having Value Like 201701,201702,201703 and so on. So, I want to find out previous month Sales so I can add it and calculate Total Sales .

Please provide me any Idea to achieve this . Thanks in advance !!

Regards

Deepak

1 Reply
aarkay29
Specialist
Specialist

something like this

Load *,

if(Isnull(peek(Sales)),0,peek(Sales))+Sales as TotalSales;

Load * Inline [

Calendar-YearMonth,Sales

201701,250

201702,350

201703,450

201704,550

];