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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
bharatkishore
Creator III
Creator III

Calculate data from specific dates

Hi All,

I have data from 2014 Jan to 2019-Sep.

Now i need to calculate data from 2015 - Jan to 2016 - Dec.

It should not be hard-coded, and every year it should change automatically.

Kindly help.

Thanks,

Bharat

17 Replies
its_anandrjs
Champion III
Champion III

This is not required as you have Year and Month fields as well as so why you do with Month Year field. Is this required let me know.

its_anandrjs
Champion III
Champion III

Also you dont have data for Dec 2017 in data model.

bharatkishore
Creator III
Creator III
Author

I will be using MonthYear only, since i will be using this field in various charts.

So that is why i will be using only MonthYear.

Please let me know if you need anything else..

bharatkishore
Creator III
Creator III
Author

No i need to calculate from Jan 2015 to Dec 2016 only not 2017 data...

its_anandrjs
Champion III
Champion III

This will give you proper result then why go for new field and new field format gives you only MM/DD/YYYY date format then why go for that. You have to go for this

Output

OP11.PNG

bharatkishore
Creator III
Creator III
Author

Thanks Anand..

Sure i will use this one, but the last thing is if we un-select the 2016 data then it default dates are changing.. i needed without selecting anything the dates are 2015 Jan to 2016 Dec.

Sorry for asking more.. but this is what i needed. Below image for reference:

T.PNG

Defaultly without selecting anything it should show from Jan 2015 to Dec 2016

its_anandrjs
Champion III
Champion III

Then in formula use this expression

=sum({<Year={">=$(=Max(Year)-2) <=$(=Max(Year)-1)"},Month={">=$(=Max(Month)-12) <=$(=Max(Month))"}>}SystemYr_sql)

bharatkishore
Creator III
Creator III
Author

Thanks a lot Anand.