Create sum of the last timestamp grouped by day

HI !!!
currently I have this data

timestamp - value - status
1.1 - 1 - A
1.2 - 2 - B
2 .1 - 5 - A
2 .1 - 1 - A
3 .1 - 2 - A

I want create a sum of the last timestamp gruped by day

example final table should show something like :
timestamp - value - status
1.2 - 2 - B
2 .2 - 1 - A
3 .1 - 2 - A

TOTAL OF SUM WOULD 5
anyone could help me with this .TIA !!!

It’s always best to start a new thread or topic when you have a question rather than add onto an old thread.

I have moved Daniel’s question to a new topic. Thanks!

1 Like

As a first step can you show the NRQL you would use to produce the results you want to group? Lets ensure you can use NRQL first and then the community can advise you on how to work toward your goal using that query.

data:
timestamp - value - status
1.1 - 1 - A
1.2 - 2 - B
2 .1 - 5 - A
2 .1 - 1 - A
3 .1 - 2 - A

My knowless in NRQL is to basic but the query that I would use in SQL would be

select
date(timestamp),
sum(value) from
data
where timestamp in (select max(timestamp) from data group by date(timestamp) )
group by date(timestamp)

final result :
timestamp - value - status
1.2 - 2 - B
2 .2 - 1 - A
3 .1 - 2 - A

I need filter the data with last timestamp reported by day

Might want to start here:

1 Like

There is also an NRQL Lessons app, which you may deploy to your account to practice writing queries against your own data:

NRQL does support nested queries for aggregation, but it does not support SQL’s WHERE … IN syntax.

I have tried with nested queries but it does not meet the objective, If you come up with other solution it would help a lot, Thanks

this query works:
SELECT filter(sum(testtime), WHERE tiempolast in (1634916619.228009) ) AS ‘Total Items’ from Metric FACET status WHERE app.name = ‘testtime’ since 3 hours ago

but I need this timestamps 1634916619.228009 would be a parameter something like :

SELECT filter(sum(testtime), WHERE tiempolast in (select max(tiempolast) FROM Metric facet dateOf(timestamp) WHERE app.name = ‘testtime’)) AS ‘Total Items’ from Metric FACET status WHERE app.name = ‘testtime’ since 3 hours ago