Forum Discussion
Anonymous
5 years agoNot applicable
Difference between rows based on ascending time
Hi guys I want to calculate differences between volume per ID. I have no possibility to create Index in PQ.
So for example I want the yearliest value that day for that ID to be 0, then as per example :
7.17-7.16
7.16-7.15 and so on
2 Replies
- amitchandakSuper User
Anonymous , Try
A new colum =
var _max = maxx(filter(Table, [Id] = earlier([ID]), [Timestamp at Datetime] <earlier([Timestamp at Datetime] )),[Timestamp at Datetime] )
return
if(isblank(_max), blank(), datediff(_max,[Timestamp at Datetime] , second))or a new measure
measure =var _max = maxx(filter(allselected(Table), [Id] = max([ID]), [Timestamp at Datetime] <max([Timestamp at Datetime] )),[Timestamp at Datetime] )
return
if(isblank(_max), blank(), datediff(_max,max([Timestamp at Datetime]) , second))- AnonymousNot applicable