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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
mohiahmed
Contributor III
Contributor III

Current Month V Previous Month

Hello,

I need some help with a query and any help would be greatly appreciated.  Trying to show current month v previous month as calculations and finding it difficult.  Table 1 I have main numbers and table 2 I am trying to show the difference and don't know where I am going wrong.

Table 1

Table 1.PNG

Table 2

Table 2.PNG

Query in expression is sum({<[Reporting Month]={">=$(=monthstart(today()))"} >} ['MI Requirement Volumes'])-sum({<[Reporting Month]={">=$(=monthstart(today(),-12))"} >} ['MI Requirement Volumes'])

Regards

Mohi

Labels (1)
16 Replies
sunny_talwar

mohiahmed
Contributor III
Contributor III
Author

Hi Sunny, I have attached the qvw file.  It has dummy data, your help is greatly appreacitaed

sunny_talwar

Dummy data is good, but this only has data for 2016? You want to see 2016-2015 right? How will I implement to show the change when you don't even have any data from 2015 .

mohiahmed
Contributor III
Contributor III
Author

Hi Sunny, I don;t have any data for 2015.  There will be ongoing from 2016 onwards.  need to be able to show Current month v previous month for now.  Also, will have filter for year for next year once I start getting the data

sunny_talwar

Got it

sunny_talwar

Here is one option

Sum(['MI Requirement Volumes'])-Before(Sum(['MI Requirement Volumes']))

Will work on the AsOfTable Method at a later time and will respond back

Capture.PNG

mohiahmed
Contributor III
Contributor III
Author

Thanks Sunny, so thats the Before Sum you mentioned.  I just didn't see that at all.  Many Many thanks for that and your help has been deeply appreciated.