Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

interpretation of date variables

hi,

how do I interpret the following variables please?

1.   Let varMonthEndNum = num(month(MonthEnd(AddMonths(Today(),-2,1))))

  • "num" is convert the result to number format
  • inside "month" is to calculate the  month
  • from "MonthEnd" ????? I don't understand

2.    Let varMonthEnd = date(num(MonthEnd(AddMonths(Today(),-2,1))));

  • "date"  is to convert the result to date format
  • don't get from "num" onwards
  • any help appreciated.

LC

1 Solution

Accepted Solutions
Not applicable
Author

1. AddMonths(startdate, n , [ , mode] )

Returns the date occurring n months after startdate or, if n is negative, the date occurring n months beforestartdate.

By specifying a mode (0 if omitted) the date is set to either the unmodified day of the specified month (mode=0) or the calculated day as derived from the end of the month (mode=1). FYR:Addmonths function | Qlik Community

2 months before today +(1 day before)


2. Month END:

MonthEnd() returns the latest fraction of the latest second of the latest date, i. e.: 40100,9999, and date values are integers by default, so in short, this is likely to work, as long as your CalendarDate field is recognized as a date field:

FYR:  https://community.qlikview.com/thread/62848

3.Month() is to return the month

4.Num is return the month format to number format

In simple words, I think its a function to generate a random number base on current time. Hope this helps!


View solution in original post

2 Replies
Not applicable
Author

1. AddMonths(startdate, n , [ , mode] )

Returns the date occurring n months after startdate or, if n is negative, the date occurring n months beforestartdate.

By specifying a mode (0 if omitted) the date is set to either the unmodified day of the specified month (mode=0) or the calculated day as derived from the end of the month (mode=1). FYR:Addmonths function | Qlik Community

2 months before today +(1 day before)


2. Month END:

MonthEnd() returns the latest fraction of the latest second of the latest date, i. e.: 40100,9999, and date values are integers by default, so in short, this is likely to work, as long as your CalendarDate field is recognized as a date field:

FYR:  https://community.qlikview.com/thread/62848

3.Month() is to return the month

4.Num is return the month format to number format

In simple words, I think its a function to generate a random number base on current time. Hope this helps!


arasantorule
Creator III
Creator III

Hi,

MonthEnd is used to find the last date of the month provided.

Please refer the below link for more details on date functions.

Primer for QlikView Date fields

Thanks.