Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Floor & Num Functions in Date output

Hello Guys,

I am new to Qliksense, and I would like to know the output of the following formulas for this value 20070209.

Qliksense knows 20070209 is  a date and the monthstart function retrieves 20070201 ??

FLOOR(NUM(MonthStart(DWH_Dim_ALL_Date_Day_ID)))                                                                                                                                     

FLOOR(NUM(WeekStart(DWH_Dim_ALL_Date_Day_ID)))   

I am not very sure of the role of NUM and FLOOR here.

Thank you in advance!

3 Replies
sunny_talwar

For MonthStart and WeekStart you don't really need to use Floor, but Floor is usually needed when you use MonthEnd or WeekEnd because the End functions give a timestamp such as 8/31/2017 23:59:59 and in order to remove the time component, you will need to use Floor to convert this timestamp to just this 8/31/2017.

Anonymous
Not applicable
Author

Ok thank you, but just to be sure, could you please tell me the output of both formulas for the value I have written?

sunny_talwar

You can check using Today() function

=FLOOR(NUM(MonthStart(Today()))) & Chr(10) & FLOOR(NUM(WeekStart(Today())))

Give this

Capture.PNG

If you want to see the dates, you can do this

=MonthStart(Today()) & Chr(10) & WeekStart(Today())

Capture.PNG

WeekStart will depend on what you have set in your environmental variable. But you can read about that here:

weekstart ‒ QlikView