Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
joeybird
Creator III
Creator III

show last 24 hours only - Qlik sense


Hi

looking to find how I can use set analysis to only show the last 24 hours of activity

dimension is OrderDateHour

example

01/01/2001 01:00:00

01/01/2001 02:00:00

01/01/2001 03:00:00

I have to this split into separate fields as OrderDate and OrderHour

I have found code that takes away the last 24 hours, but that's not what I am  looking to do

any ideas please

Kind Regards

19 Replies
joeybird
Creator III
Creator III
Author

Hi

yes

>=18/09/2017 13:00<=19/09/2017 13:00

The app loads every hour, so the time will change so the next load after 13:00, will be 14:00

Please help

sunny_talwar

Yes, that is what it should be doing

joeybird
Creator III
Creator III
Author

Hi

no

it seems to be adding the previous days max hour so e.g what ever the max hour is 14:00...it will add yesterdays 14:00 figure too , only to that bar on the bar chart

please help

sunny_talwar

Can you share screenshots to show what you have and what you are getting?

joeybird
Creator III
Creator III
Author

Hi

cant really but number goes as follows

app runs every hour but this example app ran at 12:00

63  25  45  45  89  78  74  47  65  62  65 55 51 62 65 45 66  74  66  72  56 45  55  103 Y Axis (Number of Orders)

13  14  15  16  17  18  19  20  21  22  23  0   1   2   3   4   5   6     7    8    9  10  11  12  x Axis (Hour of the day)

the issue is on the 12 hour, as you can see its doubled the number (the figure is todays number for 12:00 and yesterdays 12:00)

please help

sunny_talwar

May be a data model issue... not really sure what to tell you without seeing anything

pradosh_thakur
Master II
Master II

hi guys


i might be completely wrong but can you please not use' <=' and use '<' in the last may be this

it is including both date 13:00 hour as you are using >= and <= .


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


regards

Pradosh

Learning never stops.
joeybird
Creator III
Creator III
Author

Hi

this is working more team ,

sonny's was adding yesterdays and todays max hour figure

but the max time at this moment is 13:00..its giving me yesterdays figure instead of todays figure

rest of the hours going backwards is correct

please help

pradosh_thakur
Master II
Master II

try this


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

Learning never stops.
joeybird
Creator III
Creator III
Author

Hi

think we have it team

the answer is

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

thanks team your awesome , bit of each Sunny and Pradosh code got it working

Kind Regards