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: 
Hakim-A
Creator
Creator

Set analysis + variable as date and now()

Hello,

I am trying to count the number of transaction I have in the last x hours.

Table is

Transaction_id start_time

format start_time : 'DD/MM/YYYY hh:mm:ss'

I have a parameter called vhour that can go from 1 to 168.

I've written this formula

=count({$<start_time={"$(= '>=' & start_time-($(=vhour))*0.041 & '<=' &now())"}>} distinct transaction_id)

but it seems the first condition '>=$' & start_time-($(=vhour))*0.041 is not working

when I hard-code it like this

=count({$<start_time={"$(= '>=' & '27/04/2018 12:30:00' & '<=' &now())"}>} distinct transaction_id)

it works

Could you please help me fixing the 1st formula  ?

Thank you

10 Replies
Hakim-A
Creator
Creator
Author

This formula works.

Thank you