Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
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