Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculate date

Hello the world

I am trying to work with an excel sheet of hotel reservation..and I need to figure out an Average "how long in advance people are doing there reservation ?

I have the following fields :  country, create (date it was created) and the From (first day of the reservation)

i need to do a graph to show those information....i am quite new to Qlikview, any idea how to do it ? and working with which formula ?

thanks

JP 

4 Replies
mjm
Employee
Employee

Hello Jean-Philippe,

I have attached an example of how I have completed what you needed to achieve.

I have basically used the floor function on both dates and subtracted one date from the other to work out the difference in days between the order creation and the from date.

When I then built a chart or table from this data I used the avg() function to take an average value of the difference.

I hope this helps.

Please mark as answered if so.

Not applicable
Author

Small detail: the floor() function is not needed here.

Floor is needed, when the field is a datetime field and you only want to keep the date-part. Here you only have the date-part, so the result with of without floor() is the same.

And:

=avg(From -Created) as an expression in the given chart is also possible.

In case of many records and complex logic, I tend to fix these things in the script. Otherwise in the front-end as you are more flexible in changing things (not needed to create fields for a lot of things)

Anonymous
Not applicable
Author

Hi,

Please find the sample File in the Attachments....

anlonghi2
Creator II
Creator II

Hi Jean-Philippe. try with the attached example. Best regards