topic Re: What is the simplest way to compute for numbers of days between states ? in Windchill Systems/Software Engineering (Integrity)
https://community.ptc.com/t5/Windchill-Systems-Software/What-is-the-simplest-way-to-compute-for-numbers-of-days-between/m-p/64877#M670
<HTML><HEAD></HEAD><BODY><P>Hello Manolette,</P><P></P><P>Did <A href="https://community.ptc.com/u1/271798">Tobias Ketz</A>'s answer resolve your issue? If so, could you click on the <STRONG>Correct Answer</STRONG> link, to let everyone know that his answer solved your problem? </P><P></P><P>If not, could you let us all know why it was not helpful, so we can continue to try to help you?</P><P></P><P>Regards,<BR />Kael</P></BODY></HTML>Fri, 07 Aug 2015 17:56:38 GMTKaelLizak2015-08-07T17:56:38ZWhat is the simplest way to compute for numbers of days between states ?
https://community.ptc.com/t5/Windchill-Systems-Software/What-is-the-simplest-way-to-compute-for-numbers-of-days-between/m-p/64875#M668
I am looking for a way to compute for number of days between states in a workflow. What would be the simplest option to take. Also, it would be best if the resulting table can be downloaded to an excel spreadsheet so I can manipulate the data in various ways.The object is to determineFri, 31 Jul 2015 06:16:52 GMThttps://community.ptc.com/t5/Windchill-Systems-Software/What-is-the-simplest-way-to-compute-for-numbers-of-days-between/m-p/64875#M668mcruz2015-07-31T06:16:52ZRe: What is the simplest way to compute for numbers of days between states ?
https://community.ptc.com/t5/Windchill-Systems-Software/What-is-the-simplest-way-to-compute-for-numbers-of-days-between/m-p/64876#M669
<HTML><HEAD></HEAD><BODY><P>hi Manolette,</P><P></P><P> i think you want a field like "Days in Current State".</P><P></P><P>Your Administrator has to define an integer field " Days in Current State" with the computation:</P><P>IsEmpty(DaysCurrentState(), 0)</P><P>With the export items to excel function you can export this field and modify it in excel (im not sure why you want to modify).</P><P></P><P>If you need an matrix for every state you need a field for every state with computation like:</P><P>DaysInState("STATE")</P><P>Also you can get the Average Time in a State for a current set of items (Query):</P><P>Query("Issues for Average days in state", Project, avg(DaysInState("STATE")))</P><P></P><P>to display this information you need an item and/or create a report/dashboard</P><P></P><P>I hope this helps,</P><P>best regards,</P><P>Tobi</P></BODY></HTML>Mon, 03 Aug 2015 10:25:43 GMThttps://community.ptc.com/t5/Windchill-Systems-Software/What-is-the-simplest-way-to-compute-for-numbers-of-days-between/m-p/64876#M669tketz2015-08-03T10:25:43ZRe: What is the simplest way to compute for numbers of days between states ?
https://community.ptc.com/t5/Windchill-Systems-Software/What-is-the-simplest-way-to-compute-for-numbers-of-days-between/m-p/64877#M670
<HTML><HEAD></HEAD><BODY><P>Hello Manolette,</P><P></P><P>Did <A href="https://community.ptc.com/u1/271798">Tobias Ketz</A>'s answer resolve your issue? If so, could you click on the <STRONG>Correct Answer</STRONG> link, to let everyone know that his answer solved your problem? </P><P></P><P>If not, could you let us all know why it was not helpful, so we can continue to try to help you?</P><P></P><P>Regards,<BR />Kael</P></BODY></HTML>Fri, 07 Aug 2015 17:56:38 GMThttps://community.ptc.com/t5/Windchill-Systems-Software/What-is-the-simplest-way-to-compute-for-numbers-of-days-between/m-p/64877#M670KaelLizak2015-08-07T17:56:38ZRe: What is the simplest way to compute for numbers of days between states ?
https://community.ptc.com/t5/Windchill-Systems-Software/What-is-the-simplest-way-to-compute-for-numbers-of-days-between/m-p/64878#M671
<HTML><HEAD></HEAD><BODY><P>hi Tobi,</P><P></P><P>Sorry for not replying sooner as I was busy at work.</P><P></P><P>Your answer is the same one that my developer suggested which means that we have to introduce new fields to save the number of days a project stayed in each STATE we want to monitor. If we do this, I am thinking we need to define a trigger in each STATE that will compute the number of days in that state. So if I modify my workflow and add new STATEs that means I would add new fields and new triggers for these fields to be computed. </P><P></P><P>I want to ask if there was some other way to get the information without necessarily adding new fields. I see that each project has a history log which shows the date/time and person who moved the project to the next STATE. Can we retrieve this History log and maybe download it in Excel. I was thinking of doing a weekly extraction where I can download logs which pertain to movements to next STATE for a given date range.</P><P></P><P>If I have this, I could create a pivot table where I could display the STATES as columns for a single project giving me some sort of a timeline. Once I have this I can then I can define calculation in excel to get number of days between STATES.</P><P></P><P>Is the history even accessible to the users or is it only for INTEGRITY system use ? </P><P></P><P>best regards</P><P>Manolet</P></BODY></HTML>Sat, 08 Aug 2015 00:35:05 GMThttps://community.ptc.com/t5/Windchill-Systems-Software/What-is-the-simplest-way-to-compute-for-numbers-of-days-between/m-p/64878#M671mcruz2015-08-08T00:35:05ZRe: What is the simplest way to compute for numbers of days between states ?
https://community.ptc.com/t5/Windchill-Systems-Software/What-is-the-simplest-way-to-compute-for-numbers-of-days-between/m-p/64879#M672
<HTML><HEAD></HEAD><BODY><P><BR />Hi Manolet,</P><P></P><P>its true, you need for every (new) State a Field with the computation for this state. But you don't need a trigger, you can use the computation field:</P><P><IMG alt="2015-08-10 09_21_44-Edit Field.png" class="jive-image image-1" height="395" src="https://community.ptc.com/legacyfs/online/90402_2015-08-10 09_21_44-Edit Field.png" width="526" /></P><P>as i know you can't export the history to excel. if you want do so, you have to write a trigger and create a new field and/or tab called "logging" (or anything else). on this field your new trigger logs the last modification with modification date (maybe only state changes and only visible for administrators). Now you can export this field informations. you have to calculate the days now in excel or do it before in trigger an log only the days like: "state1:5, state2:18,..."</P><P>i think this is possible, but i wouldn't prefer this way.</P><P></P><P>best regards,</P><P>Tobi</P></BODY></HTML>Mon, 10 Aug 2015 07:40:42 GMThttps://community.ptc.com/t5/Windchill-Systems-Software/What-is-the-simplest-way-to-compute-for-numbers-of-days-between/m-p/64879#M672tketz2015-08-10T07:40:42ZRe: What is the simplest way to compute for numbers of days between states ?
https://community.ptc.com/t5/Windchill-Systems-Software/What-is-the-simplest-way-to-compute-for-numbers-of-days-between/m-p/64880#M673
<HTML><HEAD></HEAD><BODY><P>Hi Tobi,</P><P></P><P>Just for knowledge purpose, this field will give us value of Days in current state and if it spend less then 24 hour but more then 0 hour then it will give us <STRONG>0 days , </STRONG>So can we get time in current state that give us data like (Days:Hour:Minute) something like that ?</P><P>Waiting for your response Mr. Tobi.</P><P></P><P>Regards</P><P>Kapil Jain</P></BODY></HTML>Thu, 01 Jun 2017 06:25:58 GMThttps://community.ptc.com/t5/Windchill-Systems-Software/What-is-the-simplest-way-to-compute-for-numbers-of-days-between/m-p/64880#M673kjain-22017-06-01T06:25:58ZRe: What is the simplest way to compute for numbers of days between states ?
https://community.ptc.com/t5/Windchill-Systems-Software/What-is-the-simplest-way-to-compute-for-numbers-of-days-between/m-p/64881#M674
<HTML><HEAD></HEAD><BODY><P>Yes its possible,</P><P></P><P>have a look at the Administration Guide->Computed Fields</P><P></P><P>Use SecondsCurrentState() instead of DaysInCurrentState(). Now you have to calculate seconds to hours...</P><P>But i don't understand your use-case for that. We calculate this field static (every night). If you want to calculate it live, you need enough performance...</P></BODY></HTML>Thu, 01 Jun 2017 06:42:19 GMThttps://community.ptc.com/t5/Windchill-Systems-Software/What-is-the-simplest-way-to-compute-for-numbers-of-days-between/m-p/64881#M674tketz2017-06-01T06:42:19ZRe: What is the simplest way to compute for numbers of days between states ?
https://community.ptc.com/t5/Windchill-Systems-Software/What-is-the-simplest-way-to-compute-for-numbers-of-days-between/m-p/64882#M675
<HTML><HEAD></HEAD><BODY><P>Hi Tobi,</P><P>Yes i agree with you for not calculating this every time because it can affect performance. As somebody else asks this so i also replied the same and got the function as well to calculate hour in state. (<SPAN style="color: #000000; font-family: monospace, Monoser; font-size: 13px;"><STRONG>sumTimeEntryByState("State_Name")</STRONG></SPAN>)</P><P>Thanks Tobi for your quick response.</P><P></P><P>Kapil</P></BODY></HTML>Thu, 01 Jun 2017 07:04:29 GMThttps://community.ptc.com/t5/Windchill-Systems-Software/What-is-the-simplest-way-to-compute-for-numbers-of-days-between/m-p/64882#M675kjain-22017-06-01T07:04:29Z