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: 
Dayna
Creator II
Creator II

Show last 12 hours

Hi All,

I want to show the last 12 hours of values on a line chart, my data looks like this:

   

Date/HourFactoryStartTimestampQuantity Produced
26/02/2018_726/02/2018 07:00:0031043
26/02/2018_826/02/2018 08:00:0035930
26/02/2018_926/02/2018 09:00:0041116
26/02/2018_1026/02/2018 10:00:0037452
26/02/2018_1126/02/2018 11:00:0032468
26/02/2018_1226/02/2018 12:00:0024167
26/02/2018_1326/02/2018 13:00:0040477
26/02/2018_1426/02/2018 14:00:0036156
26/02/2018_1526/02/2018 15:00:0040065
26/02/2018_1626/02/2018 16:00:0033116
26/02/2018_1726/02/2018 17:00:0039209
26/02/2018_1826/02/2018 18:00:0046801
26/02/2018_1926/02/2018 19:00:0045720
26/02/2018_2026/02/2018 20:00:0045811
26/02/2018_2126/02/2018 21:00:0033601
26/02/2018_2226/02/2018 22:00:0050304
26/02/2018_2326/02/2018 23:00:0049607
27/02/2018_026/02/2018 00:00:000
27/02/2018_126/02/2018 01:00:0046693
27/02/2018_226/02/2018 02:00:0045030
27/02/2018_326/02/2018 03:00:0046847
27/02/2018_426/02/2018 04:00:0047535
27/02/2018_526/02/2018 05:00:0035166
27/02/2018_626/02/2018 06:00:0037913

The idea is that I show this on a line chart, but always the last 12 hours. Looking at other examples for 24 hours, the set analysis should be something like this, but it doesn't seem to work.

FactoryStartTimestamp = {"$(='>' & TimeStamp(Min(FactoryStartTimestamp), 'DD/MM/YYYY hh:mm:ss') & '<=' & TimeStamp(Max(FactoryStartTimestamp), 'DD/MM/YYYY hh:mm:ss'))"}

Can you advise, please?

Many thanks,

Dayna

5 Replies
sunny_talwar

May be try this

FactoryStartTimestamp = {"$(='>' & TimeStamp(Max(FactoryStartTimestamp)-0.5, 'DD/MM/YYYY hh:mm:ss') & '<=' & TimeStamp(Max(FactoryStartTimestamp), 'DD/MM/YYYY hh:mm:ss'))"}

Dayna
Creator II
Creator II
Author

Hi Sunny,

That only seems to work if I select a single date, whereas when all dates are selected, it's blank?

   

Date/HourFactoryStartTimestampQuantity ProducedRun Rate
0183168000
28/02/2018_2328/02/2018 23:00:00018000
28/02/2018_2228/02/2018 22:00:00018000
28/02/2018_2128/02/2018 21:00:00018000
28/02/2018_2028/02/2018 20:00:00018000
28/02/2018_1928/02/2018 19:00:00018000
28/02/2018_1828/02/2018 18:00:00018000
28/02/2018_1728/02/2018 17:00:00018000
28/02/2018_1628/02/2018 16:00:00018000
28/02/2018_1528/02/2018 15:00:00018000
28/02/2018_1428/02/2018 14:00:00018000
28/02/2018_1328/02/2018 13:00:00018000
28/02/2018_1228/02/2018 12:00:00018000
28/02/2018_1128/02/2018 11:00:00018000
28/02/2018_1028/02/2018 10:00:00018000
28/02/2018_928/02/2018 09:00:00018000
28/02/2018_828/02/2018 08:00:00018000
28/02/2018_728/02/2018 07:00:00018000
27/02/2018_2327/02/2018 23:00:00018000
27/02/2018_2227/02/2018 22:00:00018000
27/02/2018_2127/02/2018 21:00:00018000
27/02/2018_2027/02/2018 20:00:00018000
27/02/2018_1927/02/2018 19:00:00018000
27/02/2018_1827/02/2018 18:00:00018000
27/02/2018_1727/02/2018 17:00:00018000
27/02/2018_1627/02/2018 16:00:00018000
27/02/2018_1527/02/2018 15:00:00018000
27/02/2018_1427/02/2018 14:00:00018000
27/02/2018_1327/02/2018 13:00:00018000

Many thanks,

Dayna

sunny_talwar

Would you be able to share a sample file to check this out?

Dayna
Creator II
Creator II
Author

I thought you'd ask, but not easily unfortunately, I'll carry on and see how I get on. Thanks Sunny!

pablolabbe
Luminary Alumni
Luminary Alumni

When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others