Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey ALL,
I have a field Year_Month looks like:
Year_Month
201311
201312
201401
201402
201403
201404
201405
201406
201407
201408
201409
201410
201411
201412
201501
201502
201503
201504
201505
201506
201507
201508
201509
201510
201511
201512
if i want to to calculate one year back ei. if i have 201512 i need to see the value ok 201412 what function should i use.
Thank you,
Can you elaborate of where exactly are you trying to do it? In script? straight table?
Hi
You could try something like
LEFT(GetFieldSelections(Year_Month),4) -1 & Right(GetFieldSelections(Year_Month),2)
Mark
I agree that AddMonths or AddYears is the way to go. But where are we doing this? How can we recommend anything before knowing that
Sunny agreed with you. He asked for function what function should i use.
And I told him same with some examples
hey sunny i need to use this in the Set analysis part :
Year_Month={">=one year back <=max Year_Month"}>}
Thank you
Assuming Year_Month is a date field, may be this:
{<Year_Month = {"$(='>='& Date(AddYears(Max(Year_Month), -1), 'YYYYMM') & '<=' & Date(Max(Year_Month), 'YYYYMM'))"}>}
Hi ,
Check this ,
Temp:
LOAD * ,
If(Mid(Year_Month,1,4),'2014',2015) as Year,
Mid(Year_Month,5,6) as Month
INLINE [
Year_Month
201311
201312
201401
201402
201403
201404
201405
201406
201407
201408
201409
201410
201411
201412
201501
201502
201503
201504
201505
201506
201507
201508
201509
201510
201511
201512
];
Data:
Load Year&Month as [Year-Month]
Resident Temp;
output:
HTH,
Hirish