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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
pascos88
Creator II
Creator II

Take only the last hours last reload

Hello,

I have a chart that show me the data of the all 2015. there are already a calendar and all data is possible to have for a fixed instant.

Now I would like to show in the chart just the data inherent of the last hour from the last reload.

Someone can help me?

Regards and Happy new Year

6 Replies
jyothish8807
Master II
Master II

Hi Pasquale,

I am not completely clear about your requirement, so try something like this :

create a field in backend which capture the reload time:

Load

reloadtime() as Timefield,

from <>;

In expression:

Sum(<Yourdatefield={'Timefield+1'}>}Sales)

You can give a try or please explain a bit more about your requirement.

Regards

KC

Best Regards,
KC
sinanozdemir
Specialist III
Specialist III

Hi,

One approach could be to capture the reload time with ReloadTime() function:

Capture.PNG

And then assign this to a variable and use it in your set analysis.

HirisH_V7
Master
Master

Hi,

Check this,

In Backend:

Data:

LOAD *,

Reloadtime() as  ReloadTime

INLINE [

    Customer, DataTime,Sales

    1, 04/01/2016 6:03:02 PM,33

    2, 04/01/2016 6:03:02 PM,99

    3, 04/01/2016 6:03:02 PM,88

    4, 04/01/2016 6:03:02 PM,88

    5, 03/01/2016 8:03:02 PM,88

    6, 03/01/2016 9:03:02 PM,88

];

Front end:

Chart expression:-            If(Hour(DataTime)=Hour(ReloadTime),Sum(Sales))

PFA,

HTH,

-Hirish

HirisH
pascos88
Creator II
Creator II
Author

hello Sinan,

thanks for reply.

How I can take the date from the 1 hour before?

For example your picture shows 2:04, in this case I need to take the data from 1:04 to 2:04.

Later I will use this in my set analysis

Regards

Not applicable

First you need a field in the data which stores the date and time data for my example I will call this field Date (p.s it must be formatted as a timestamp in script)

Then simply use this function in your expression replacing the field I have called 'data' with the field in your dataset you want to sum.

=sum({< Date  = {">$(= timestamp(ReloadTime()- 0.04167))"}>} data)

p.s in a timestamp 0.04167 is 1 hr...so reloadtime - 0.04167 will be an hour before it.

sinanozdemir
Specialist III
Specialist III

Something like the below:

Count({<SessionLogTime = {">=$(=Time($(vReloadtime) - Time('01:00', 'hh:mm')))"}>}Distinct SessionID)