Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
'FY' & Right(Year(AddMonths([CreatedOn],-6)),2) & '/' & Right(Year(AddMonths([CreatedOn],6)),2) AS [Financial Year],
pls explain me (AddMonths([CreatedOn],-6)),2 what -6 do here? full expression clearly
Hi,
By AddMonths([CreatedOn],-6)) expression we go back 6 months back it would be like in [CreatedOn] date this function less 6 months and give out put
Ex:- if date is 30/10/2014 it will show 30/4/2014
And in this line Right(Year(AddMonths([CreatedOn],-6)),2) it calculate Year(AddMonths([CreatedOn],-6)) and then from right 2 values that is YY is fetched.
Same is going on the other expression.
Regards
Anand
Hi,
AddMonths([createdOn],-6) will take you 6 months back..
say if today is month of October-2014 and if I apply above formula then it will return April-2014..
HTH
Sushil
(AddMonths([CreatedOn],-6)),2) what about 2 here
Hi,
By AddMonths([CreatedOn],-6)) expression we go back 6 months back it would be like in [CreatedOn] date this function less 6 months and give out put
Ex:- if date is 30/10/2014 it will show 30/4/2014
And in this line Right(Year(AddMonths([CreatedOn],-6)),2) it calculate Year(AddMonths([CreatedOn],-6)) and then from right 2 values that is YY is fetched.
Same is going on the other expression.
Regards
Anand
the months are going backwards: not added but back in time (-6 months)
Hi,
If you are looking for Master Calendar.
Follow the below link.
http://community.qlik.com/blogs/qlikviewdesignblog/2012/10/16/the-master-calendar
From right 2 values that is YY is fetched.
Regards
Anand
it means 2014 so it is going to fetch 14 only right?
Yes right..
Regards
Anand
Hi Manoj,
Check this
Right(Year(AddMonths([CreatedOn],-6)),2)
- AddMonths([CreatedOn],-6) will give you the date past (subtract) 6 months from created on date,
For example AddMonths(Today(), -6) will give you 4/30/2014
- Year(AddMonths([CreatedOn],-6)) - Year() will give the year for the above date
Right(Date, 2) - will give you the right most characters in the date, ie, 2014
Instead you can simply do this by using
Date(AddMonths([CreatedOn],-6), 'YY')
Hope this helps you.
Regards,
Jagan.