Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

if condition between two time stamps

Hi Experts,

i need to do an if condition between two times

Accesstime, Clearingtime. these are not in the timestamp format.

My condition is if (Accesstime - Clearingtime) is less than 30 minutes, then count the distinct salesproducts by year.

i m trying the below expression

IF(Time(Accesstime ,'hh:mm:ss')-Time(Clearingtime,'hh:mm:ss') <=('00:30:00'),

count(DISTINCT ProductNumber))

This expression is working fine if my dimension is ProductNumber.

but i want to calculate this by year, by month,.. it is not working with my calendar dimensions

Please help me to correct my expression

1 Solution

Accepted Solutions
sunny_talwar

You can try this:

Count(DISTINCT If(Time(Accesstime ,'hh:mm:ss')-Time(Clearingtime,'hh:mm:ss') <=('00:30:00'), ProductNumber))

View solution in original post

3 Replies
sunny_talwar

You can try this:

Count(DISTINCT If(Time(Accesstime ,'hh:mm:ss')-Time(Clearingtime,'hh:mm:ss') <=('00:30:00'), ProductNumber))

Anil_Babu_Samineni

Try this too

IF(Time(Interval(Accesstime - Clearingtime),'hh:mm:ss') <=('00:30:00'),

count(DISTINCT ProductNumber))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

thank you so much sunny