Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Then in formula use this expression
=sum({<Year={">=$(=Max(Year)-2) <=$(=Max(Year)-1)"},Month={">=$(=Max(Month)-12) <=$(=Max(Month))"}>}SystemYr_sql)
Elaborate more
1. Do you have date fields in model
2. You need to load data
3. Or else you need to calculate data.
Hi Anand,
I have date field below image for reference:
I have data from Jan 2014 to Sep 2017.
I need to calculate sum(myfield) from Jan 2015 to Dec 2016.
Please let me know if you require anything more.
Thanks,
Bharat
Loading data from table try this
Load
*
From Source Where
Datefield <= YearStart(AddYears( Max(Datefield), -3)) and
Datefield >= YearEnd(AddYears( Max(Order_Date), -2))
Your date is in string format or num format.
Or can you provide sample data.
Thanks for the reply.
PFA qvw for more understanding.
Thanks,
Bharat
pfa
May be like this
sum({<Monthyear={ >=$ (=Yearstart(Monthyear),-3) <=$ (=Yearend(Monthyear),-1) }>}Myfield)
-Mahesh
Check the attached
Expre:-
=sum({<Year={">=$(=Max(Year)-1) <=$(=Max(Year))"},Month={">=$(=Max(Month)-12) <=$(=Max(Month))"}>}SystemYr_sql)
Hi Anand,
Request you please find the attached file and there i have derived a new MonthYear field.
With this can we achieve and i need data from 2015 Jan to 2016 Dec.
In your file it is Jan 2016 to Sep 2017.
Please let me know if you require anything more.
Thanks,
Bharat