Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Count within 7 days or N number of days.

Hi,

I have a scanario where I need to find the number of days. I have two days between I need to find. What is the best approach to find the day. Right now I am using interval ( one date field - another date field) <7, then count so particular column. Need some more optimized query to perform this operation.

Best Regards,

SKumar

5 Replies
Not applicable
Author

Interval will compute the duration in hrs, min and sec. For just days, you can directly use date1-date2.

Kiran.

Not applicable
Author

Hope it helps!

age( timestamp, date_of_birth )

Returns the age at the time of timestamp (in completed years) of a

someone born on date_of_birth.

Example:

age('2007-01-25', '2005-10-29') returns 1

age('2007-10-29', '2005-10-29') returns 2

Anonymous
Not applicable
Author

Hi, Age function will return the year of your age. So it doesn't help in my case. If you know any function which returns the number of days in count, that please share with me. It would be great if you have any script or expression for bucket analysis, you can attach the sample, that would be great help. Thanks, SKumar

Anonymous
Not applicable
Author

Hi Kiran, I am tried to do the same thing in my expression but it does not return any value. I have two date field column, where I did (Date_Received-Date_Issued) but it doesn't work. Do i need to add any additional function to return the number of days? Best, Skumar

Not applicable
Author

Kumar,

For the dimensions in the table if only one value of Recieved date and issued date exist then the expression will work. To check if multiple values are there use AVG(Date_Received-Date_Issued).

Regards,

Kiran.