Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Calculate between rows
csasaki
Hi
I want to calculate some values between rows. I Have this :
* I have group by ID :
*1,2,3,4 is a running count
************************************************************************
ID SUMMARY PrevState New_state Timestamp
120 Campo solo acepta 5 d?gitos
1 Accepted Assigned Sep 14, 2012 10:19 AM
2 Corrected Deployed Sep 14, 2012 2:55 PM
3 Accepted Assigned Sep 17, 2012 10:32 AM
4 Corregid Deployed Sep 17, 2012 4:21 PM
************************************************************************
I Have to calculate the time between the time when it passed from "Accepted" to "Assigned".
How can I do it?
Calculate only when 1-2 , 3-4, etc?. How?.
Also if the last row is Accepted-Assigned show the time between that date and toda.
Hope you can help me!
Find more posts tagged with
Comments
csasaki
I used this post in the forum to solve my problem.
http://www.birt-exchange.org/org/forum/index.php/topic/20155-time-diffrence-different-rows/page__hl__calculate row__fromsearch__1
I'm looking for how to know how many rows are being dpeloyed.
mwilliams
So, the difference issue is solved? Can you explain more about what you mean by looking for how many rows are being deployed?
csasaki
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="109573" data-time="1348075118" data-date="19 September 2012 - 10:18 AM"><p>
So, the difference issue is solved? Can you explain more about what you mean by looking for how many rows are being deployed?<br /></p></blockquote>
<br />
Hi Mr. Williams<br />
<br />
Well actually the difference issue is not solved, and really dont know why. This is my data :<br />
<br />
WI_ID Estado_Previo Estado_Nuevo Timestamp1 Timestamp2 <br />
120 <br />
1 Aceptado Asignado Sep 14, 2012 10:19 AM impar <br />
2 Corregido Despliegue Sep 14, 2012 10:19 AM Sep 14, 2012 2:55 PM 0 (problemhere)<br />
3 Aceptado Asignado Sep 14, 2012 2:55 PM Sep 17, 2012 10:32 AM impar <br />
4 Corregido Despliegue Sep 17, 2012 10:32 AM Sep 17, 2012 4:21 PM 0 <br />
<br />
<br />
In the 0, I'm trying to calculate the minutes between those 2 timestamps BUT I'm getting 0, this is my code :<br />
<br />
***************************************************************************************************<br />
var temp = BirtMath.mod(row["Aggregation"],2);<br />
<br />
if (temp == '0') <br />
{ <br />
<br />
<br />
var Fecha_param_1 = row["Column Binding"];<br />
var Fecha_param_2 = row["TIMESTAMP"];<br />
var semanas = BirtDateTime.diffWeek(Fecha_param_1,Fecha_param_2);<br />
var dias = BirtDateTime.diffDay(Fecha_param_1,Fecha_param_2);<br />
var dias_completos = (dias - semanas*2 - 1);<br />
output = dias_completos;<br />
if (dias_completos =="-1")<br />
{<br />
var minutos_total=BirtDateTime.diffMinute(Fecha_param_1,Fecha_param_2);<br />
var output = minutos_total<br />
<br />
} <br />
<br />
output;<br />
<br />
}<br />
else<br />
{ var output ="impar";<br />
output;<br />
}<br />
***************************************************************************************************<br />
But when I do diffMinute between any Fecha_param_1 or Fecha_param_2 with Now(); it gets a number but not between them. Why?
csasaki
OK
Finally got it !
******************************************************
121
1 Aceptado Asignado Sep 14, 2012 10:21 AM
2 Corregido Despliegue Sep 14, 2012 10:21 AM Sep 17, 2012 11:08 AM 3 dia(s), 0 hora(s), y 47 minuto(s).
124
1 Aceptado Asignado Sep 17, 2012 3:30 PM
******************************************************
But How can I know how many rows are? Because I want to put if the last row is Odd, calculate the time between that date and now. For example :
******************************************************
124
1 Aceptado Asignado Sep 17, 2012 3:30 PM "Here Time between the date and now"
******************************************************
mwilliams
If you had a count of your total rows, you could keep a running count of your rows, as you go. When you reach the last row (running count = total rows), if it's odd, you'd do your special calculation.