Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
luiscbrum
Contributor
Contributor

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.

luiscbrum
Contributor
Contributor
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