Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi QV,
Can any one explain differences between below functions with sample exampls.
Month Functions:
--------------------
1)AddMonths
2)MonthStart
3)MonthEnd
4)SetDateYearMonth
5)MonthName and MonthsName
Year Functions
----------------------
YearStart
YearEnd
SetDateYear
YearName
WeekYear
HI
Please see the example which you can understand easily
AddMonths(Today(),2) gives 24/8/2014
AddMonths(Today(),-2) gives 24/4/2014
MonthStart(Today()) gives 1/6/2014
MonthStart(Today(), -2) gives 1/4/2014
MonthEnd similar to MonthStart
SetDateYearMonth(Today(), 2012 , 1) gives 24/1/2012
MonthName (Today()) gives Jun 2014
MonthsName(2,Today()) gives May-Jun 2014
Returns a display value showing the months of the period (formatted according to the MonthNames script variable) and year with an underlying numeric value corresponding to a timestamp with the first millisecond of the n month period (starting from January 1st) containing date. N must be (1), 2, (3), 4 or 6. Shift is an integer, where the value 0 indicates the period which contains date. Negative values in shift indicate preceding periods and positive values indicate succeeding periods. If you want to align with (fiscal) years not starting in January, indicate a value between 2 and 12 in first_month_of_year.
YearStart(Today()) - gives 1/1/2014
YearEnd(Today()) - gives 31/12/2014
SetDateYear(Today(), 2012) gives 24/06/2012
Yearname(Today()) gives 2014
Returns a four-digit year as display value with an underlying numeric value corresponding to a timestamp with the first millisecond of the first date of the year containing date
WeekYear(Today()) gives 2014
The year to which the week number belongs.
HI
Please see the example which you can understand easily
AddMonths(Today(),2) gives 24/8/2014
AddMonths(Today(),-2) gives 24/4/2014
MonthStart(Today()) gives 1/6/2014
MonthStart(Today(), -2) gives 1/4/2014
MonthEnd similar to MonthStart
SetDateYearMonth(Today(), 2012 , 1) gives 24/1/2012
MonthName (Today()) gives Jun 2014
MonthsName(2,Today()) gives May-Jun 2014
Returns a display value showing the months of the period (formatted according to the MonthNames script variable) and year with an underlying numeric value corresponding to a timestamp with the first millisecond of the n month period (starting from January 1st) containing date. N must be (1), 2, (3), 4 or 6. Shift is an integer, where the value 0 indicates the period which contains date. Negative values in shift indicate preceding periods and positive values indicate succeeding periods. If you want to align with (fiscal) years not starting in January, indicate a value between 2 and 12 in first_month_of_year.
YearStart(Today()) - gives 1/1/2014
YearEnd(Today()) - gives 31/12/2014
SetDateYear(Today(), 2012) gives 24/06/2012
Yearname(Today()) gives 2014
Returns a four-digit year as display value with an underlying numeric value corresponding to a timestamp with the first millisecond of the first date of the year containing date
WeekYear(Today()) gives 2014
The year to which the week number belongs.
Please see the help in the Qlikview desktop. Its has been explained very well in that.
Please find attached a sample App ! ! !