Shri G Posted April 27, 2023 Share Posted April 27, 2023 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 More sharing options...
Fredrik Rosell Posted April 27, 2023 Share Posted April 27, 2023 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())<=5DateDiff is used to calculate the difference between two datetimes, and I use DateTimeNow to get the current time. Link to comment Share on other sites More sharing options...
Shri G Posted April 28, 2023 Author Share Posted April 28, 2023 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 More sharing options...
Fredrik Rosell Posted April 28, 2023 Share Posted April 28, 2023 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 More sharing options...
Shri G Posted May 25, 2023 Author Share Posted May 25, 2023 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:Expected Output: 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 More sharing options...
Solution Fredrik Rosell Posted June 5, 2023 Solution Share Posted June 5, 2023 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: 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 More sharing options...
Shri G Posted June 6, 2023 Author Share Posted June 6, 2023 Thank you so much @Fredrik Rosell for all your help! 😊 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now