Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

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: 
priyanshi
Contributor III
Contributor III

Floor Function

How do I use floor function for date?

Thanks

11 Replies
sunny_talwar

You can use to get just the date (excluding the time). For example try this:

Date(Floor(Now())) -> will give you just the date

Time(Frac(Now())) -> will give you just the time

qlikmsg4u
Specialist
Specialist

Clearly it removes time part from the date

first try this in text object

=Now()

then try this

=Date(Floor(now()))

you will find the difference

sunny_talwar

See if the attached helps:

Capture.PNG

bharani8
Creator III
Creator III

What is the diff btw =Date(Floor(now())) & =Date(now())... I see both returning same value

Anil_Babu_Samineni

This is old thread, Some how look Floor() in help - Floor ‒ QlikView

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
bharani8
Creator III
Creator III

Saw that.. But not able to understand clearly.. On what circumstances floor func will be useful in Biz cases? any simple example / illustration ?

Anil_Babu_Samineni

Example is there where we use floor() and ceil() in qlikview?

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
bharani8
Creator III
Creator III

TY!

Siva_Sankar
Master II
Master II

Ceil function will round up a number. Ex: ceil(3.4) will return 4.

Floor will round down a number. Ex: floor(3.4) will return 3.

I use this when working with timestamps with hour and minutes values. Behind each date there's a number associated. Those dates with time, will have a decimal value (56321,23) where 23 represents the time and minutes (this is a random example!).

When in your model you don't need to use the hour, you can use ceil(Date) so your dates will always be DD/MM/YYYY 00:00:00 instead of DD/MM/YYYY 10:36:00.

This can also be used to format values. If you are working with big amounts, it might not tell you much to show the decimal. Instead of showing $26.354.201,31, you can use the ceil or floor function and round up/down the number, or using the format in the Number tab for the charts.

Advantage: It will helps to save lot of memory since it trims of timestamp.

For More: Get the Dates Right

-Siva