Jump to content

Data of Last 5 min


Shri G
Go to solution Solved by Fredrik Rosell,

Recommended Posts

Hi All,

I have a Access Date and Access Type columns in my dashboard. I have to display the the Access Type data with Access Date of last 5 min of current date time.

Can somebody please help me with this?

Thanks in advance!

Link to comment
Share on other sites

Hello,

How to solve this depends on exactly what you are trying to achieve - e.g. do you only want to import data from the last 5 minutes, do you want only a certain plot to only show data from the last 5 minutes, etc?

Here's an example of where I configured a certain plot to just display data from the last 5 minutes using "Limit data using expression", with the expression:

DateDiff('minute',[Access Date],DateTimeNow())<=5

DateDiff is used to calculate the difference between two datetimes, and I use DateTimeNow to get the current time.

DateDiff.thumb.PNG.2e5b743ac484cbbe1394a35d0129b1af.PNG

Link to comment
Share on other sites

Hi @Fredrik Rosell​ 

Thank you so much for your reply!

This is working but only for last 5 min of data irrespective of access type. I want to apply this over access type as well like for each access type data of last 5 min should be displayed.

e.g. sample data table that you have shared, we should be able to see the data for Access type "2" as well along with "1". Last 5 min data of "1" and "2" access type.

Can you please help me with this?

Thanks in advance!

Link to comment
Share on other sites

Hello!

Based on the original statement - "I have to display the the Access Type data with Access Date of last 5 min of current date time." - I do not yet understand how the Access Type becomes a factor.

Is the comparison in fact with the most recent entry for each Access Type - not the current date time?

Using the data in my example as an example:

* The latest/most recent entry for Access Type 1 is 04:50:00 - show all Access Type 1 in the last 5 minutes from that, i.e. 04:45:00 - 04:50:00

* The latest/most recent entry for Access Type 2 is 04:48:30 - show all Access Type 2 in the last 5 minutes from that, i.e. 04:43:30 - 04:48:30 

Link to comment
Share on other sites

  • 4 weeks later...

Hi @Fredrik Rosell​ Thank you so much for your inputs. The given inputs are working. But there is slight change in requirement. I have to display data of last 5 min for all Access Type from the date of their first login.

example Data:

image.png.86e87495c14654c81eb7026cc712f318.pngExpected Output:

image.png.18eca4c67598ac48bdf94009652b1e82.png 

Highlighted records are the first login of respective user for specific access type. Considering that Access date time, I have to display 5 min of data from that access date

Link to comment
Share on other sites

  • 2 weeks later...
  • Solution

Hello,

I just saw the additional question here. In case the latest requirement is not yet resolved, I do not understand the example - how the data in the expected output matches what was described - but as a general approach, you might want to explore using calculated columns with OVER expressions to segment your data.

As a very basic example, see the following example:

5minutes.thumb.PNG.f47363b6dd34eb39b73c24c8f7c77e04.PNG 

I first calculated the first login of each user:

Min([Access Date]) OVER ([user])

I then checked if the Access Date is within 5 minutes of the first login of that user: 

If(DateDiff('minute',[Min([Access Date]]) OVER [user]]],[Access Date])<=5,True,False)

See "OVER in Calculated Columns" in the Analyst manual for more information:

https://docs.tibco.com/pub/sfire-analyst/12.4.0/doc/html/en-US/TIB_sfire-analyst_UsersGuide/index.htm#t=ncfe%2Fncfe_over_in_calculated_columns.htm

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...