Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
QSense
Creator II
Creator II

sum of max date

Hello ,

I have a problem while summing an expression includes max date field.

My expression below.

= sum( if(Num(interval(max(Timestamp(BT))-max(Timestamp(AT)),'d'),'#.##')<=7,1,0) )

In shortly I can explain my problem; I have an ID and according to this ID I get 3 records ,

I wanna get max BT date record and then according to number coming from interval ı will classify the record such as 0 and 1

and then at last ı wanna sum of this classified numbers.

I m looking forwards solutions

regards

10 Replies
Chanty4u
MVP
MVP

= sum( if(Num(interval(Timestamp(Max(BT))-Timestamp(Max(AT)),'d'),'#.##')<=7,1,0) )

QSense
Creator II
Creator II
Author

Thanks for reply

it is the  same with I wrote .

It does not work

MayilVahanan

Hi

Try in script for faster calculation in front end (Charts)

Load Id, Floor(Max(AT)) as MaxAT, Floor(Max(BT)) as MaxBT resident yourtablename;

Then in front end, try like this

Id - Dimension

Sum(If(MaxAT - MaxBT <= 7, 1, 0))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Chanty4u
MVP
MVP

did u try replace Timestamp with Date?

QSense
Creator II
Creator II
Author

I tried but unfortunately it is not working

QSense
Creator II
Creator II
Author

I can not change script side since I had no chance to access server.

I have to change via accespoint

Chanty4u
MVP
MVP

try this,

The date  format is same? if not set the date format

SET TimestampFormat = 'DD/MM/YYYY hh:mm';  [based on ur date format]

Timestamp(Num#(Date))


Num#(Date)

Anonymous
Not applicable

write the expression at max function is using  like the Date=$(=Max(Date))

QSense
Creator II
Creator II
Author

format are same I change expression like below

=sum ( if(Timestamp( max(BT) ) - Timestamp( max(AT) ) <=7 ,1,0) ) but it also does not work