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: 
er_mohit
Master II
Master II

MTD vs LMTD Comparision On Backend Script

Hi All,

I have a Calendar based on day basis as per attached application.

I want to make MTD vs LMTD logic as per calendar used in given sample application.

Here, in thaqt i have added some scenario to getting the desired output.

Please have a look into this.

Any help will be appreciable.

8 Replies
er_mohit
Master II
Master II
Author

Hi All,

Please help me to resolve this

er_mohit
Master II
Master II
Author

Hi gwassenaar

Please help me to get out from this issue.

sunny_talwar

I am trying to decipher your requirement, but not really sure what you are looking to do. Can we do it one at a time? So that the clutter can be simplified? What is the first thing you want to work on?

Capture.PNG

er_mohit
Master II
Master II
Author

Hi sunindia

Thanks for reply.

I explain you

Let's discuss on 1st scenario (Mar data).

Purpose : I want to compare the Current Month data with last month data.

(Here , comparison based on Days rather than Date)

Current Selection - 2016 and Month = Mar

So, i want a flag on that basis i calculate the current Month and Last Month sale easily.

As mentioned above output.

Hope now you understand the 2nd scenario.(based on week)

Output : comparison of Current week(2016) to last week(2015).

Selection Year = 2016 Month = Jan Week = 01

In 2016 1st Week has 9 days.

In 2015 1st Week has 3 days.

So, i want to compare as mentioned above.

Here also i want a flag which would be control by Weeks.

Hope it helps

sunny_talwar

Since you mentioned flags, are you looking for a script based solution?

er_mohit
Master II
Master II
Author

Yes, i want backend script solution. I m also trying on backend with no luck. I think on backend it become easy.

er_mohit
Master II
Master II
Author

Hi Sunny T

Any help will be appreciable.

Regards

Mohit

kavita25
Partner - Specialist
Partner - Specialist

Please provide the qvd and excel data which is there in qvw.

As without data and to implement this flags, it will throw an error while loading...

For Current Month:

TempDate is the date field

vToday is the variable : num(today())

inmonth(TempDate, $(vToday), 0) * -1 AS CM

In front end you can use CM=1 which will give you current month data for current year

Same Month Last Year

inmonth(TempDate, $(vToday), -12) * -1 AS FPM

In front end you can use FPM=1 which will give you current month data for current year

Regards,

Kavita