Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Support Cases coming to Qlik Community Oct. 4! Start chats, open cases, explore resources: READ DETAILS
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Doubt about closed months and actual month ?


I'm doing sum(sales) for example

I have to do the sum in the actual year/actual month VS last year (year -1) / same month

I created a flag to do this, the problem is that if i compare the actual month (not closed) i'm comparing the closed month of the last year vs the days passed this year

For example today i comparing Full December 2016 vs 01 and 02 December 2017

Can you help me? there is a function to do this?

Happy new year,


4 Replies
MVP & Luminary
MVP & Luminary

One way could be to include a day-level in your calculations - <= day(today()) - and another would be to use a forecast-value for your current month:

sum(Sales) / [recent workingdays] * [monthly workingdays]

whereby the workingdays could be included within the master-calendar.

- Marcus

Not applicable

But i should make a if am i right? i only use the <= day(today()) in the actual month

Champion II
Champion II

if you are using today() for your evaluation then use something as below

Previous MTD

SUM({< Month = {'$(=Month(Today()))'}, Date = {"<=$(=Date(AddYears(Today(),-1),'YourDateFormat')"} >} Sales)

Current MTD

SUM({< Month = {'$(=Month(Today()))'}, Date = {"<=$(=Date(Today(),'YourDateFormat')"} >} Sales)

MVP & Luminary
MVP & Luminary

There are several ways how you could achieve this. One would be to include the matching within the set analysis and another to create flags within the master-calendar. Here: How to use - Master-Calendar and Date-Values you will find examples for both ways and also how to flag the workingdays - and if you searched within the community for "MTD" you will find a lot of examples.

- Marcus