cancel
Showing results for 
Search instead for 
Did you mean: 

iChart dates

Former Member
0 Kudos

Hello,

I have an applet of type iChart calling an execute query which is calling a transaction. The mii server is on a CST time zone but the data I want to gather and plot is on a server following EST time zone. For that reason, I need to query data in EST time zone but display data in CST time zone. So what I am currently doing is from the mii server located on CST time zone I calculate the time offset, meaning if in CST the start time is 9/12/2011 8:00:00 and the end time is 9/12/2011 9:00:00 I send to the transaction that is supposed to get the data the offsetted dates in EST which are 9/12/2011 9:00:00 as start date and 9/12/2011 10:00:00 as end date. Now, after the data comes back, I want to display the result set and plot in CST time zone, is there a way to convert the data back to CST time without having to loop on every single record coming back?

If thatu2019s not possible, is there a way where I can send a start and end date to a transaction get the data and then force the line chart to display different date than the ones passed?

Example: If I am querying for a CST site for 9/12/2011 8:00:00 - 9/12/2011 9:00:00 I get the data in CST and display on the line chart from 8:00 u2013 9:00, now for that same chart I query for a site in a EST time zone so I sent the offsetted date time which is 9/12/2011 9:00 u2013 9/12/2011 10:00 and I get the results, now I want to force the line chart to change the dates on the x axis to be 9/12/2011 8:00:00 (CST start time) and 9/12/2011 10:00:00 (EST end time) keeping the data plotted for both the EST and the CST site.

I tried playing around with u201CShow Times in Server Time Zoneu201D property available for the iChart but that didnu2019t seem to work and for some reason the SAP mii documentation doesnu2019t mention anything about it.

Thanks,

Mona

Accepted Solutions (1)

Accepted Solutions (1)

agentry_src
Active Contributor
0 Kudos

Hi Mona,

Are you retrieving the data from a historian or some other date time series data source?

Also please provide the version, service pack, and build of MII, java jre, and if applicable, NW.

Thanks,

Mike

Former Member
0 Kudos

Hello Mike,

We are retrieving data from the historian and depending on the location of the historian we need to query each one with its relative time zone the convert it back to a common standard time zone.

MII Veriosn 12.1.7.50 Build 50

Java JRE: 1.6.0_20

NW Version: 7.1

Thanks,

Mona

agentry_src
Active Contributor
0 Kudos

Hi Mona,

Are you retrieving the data through a local MII installation and then passing it to a central MII installation?

Are you using PCo or UDS as the intermediary to the historian from MII?

Thanks,

Mike

Former Member
0 Kudos

Hi Mike,

The queries reside on a central MII location which is connecting to a local mii installation through a virtual IDBC connection. We have some logic on the central MII location that calculates the time offset depending on the timezone difference and gives the offsetted date/time prior to quering it at the site. All this is going through a UDS connection.

Thanks,

Mona

agentry_src
Active Contributor
0 Kudos

Hi Mona,

Can you try a direct Tag Query from the central MII installation and see if the UDS/MII automagically does the conversion? I think I remember this being a feature in either the UDS or in PCo. Are your historians all one type or are they a variety of vendors?

Regards,

Mike

Edited by: Michael Appleby on Sep 15, 2011 1:03 PM

Former Member
0 Kudos

Hi Mike,

Using a direct tag query from central MII installation did not automatically do the conversion. We are trying to connect to PI and IP21 historians.

Thanks,

Mona

agentry_src
Active Contributor
0 Kudos

Hi Mona,

I would suggest taking a look at Doug's [solution|;. It would probably work for you.

Regards,

Mike

Former Member
0 Kudos

Hi Mike,

We are already doing what Doug is doing but in a different manner using an mii transaction, so that is not as issue for us.

Here's what the problem is:

Let's say it is 9:00 am in the central mii instance (CST) and I want to get data between 9:00 am and 10:00 am CST.My historian is on a different time zone (EST) so the current time would be 10:00 am historian time which means that from the central mii instance I have to send to the historian a date range of 10:00 am to 11:00 am EST. I am able to do that after doing some calculation in mii to offset the time depending on the timezone. Now, after querying the historian for 10:00 - 11:00 EST let's say I get a this sample result set:

Date/Time Value

9/13/2011 10:00:00 EST 23.4

9/13/2011 11:03:00 EST 34.4

9/13/2011 12:05:00 EST 35.3

9/13/2011 13:10:00 EST 35.9

Now I want the dates reverted back to central time and displayed on the line chart according to central times as follows:

Date/Time Value

9/13/2011 09:00:00 CST 23.4

9/13/2011 10:03:00 CST 34.4

9/13/2011 11:05:00 CST 35.3

9/13/2011 12:10:00 CST 35.9

I really don't think that what I'm trying to do is possible without looping on every single record of the result set but I thought

it is worth asking.

Thanks,

Mona

agentry_src
Active Contributor
0 Kudos

Hi Mona,

Try using a calculated column action block with your xml datasets. You might even want to add columns for each of your specific timezones of interest (dataset grows, but the calculations are done one time). If you are just USA, then it is probably the best approach.

Let me know if this works out for you.

Regards,

Mike

Edited by: Michael Appleby on Sep 15, 2011 7:29 PM

Former Member
0 Kudos

Hi Mike,

Let me try it out and get back to you.

Thank you very much!

Mona

Former Member
0 Kudos

Hi Mike,

I tried your recommendation, without a repeater it converts only the first value. See the following:

ESTDateTime Value CSTDateTime

09/15/2011 14:05:17 415.13 09/15/2011 13:05:17

09/15/2011 14:46:17 415.89 09/15/2011 13:05:17

09/15/2011 14:56:17 415.55 09/15/2011 13:05:17

09/15/2011 15:01:17 414.40 09/15/2011 13:05:17

09/15/2011 15:08:17 415.21 09/15/2011 13:05:17

That's because in the calculated column block I am specifying the result of the query (i.e: qTagHistory_0.Results{/Rowsets/Rowset/Row/DateTime}) and not a repeater. Adding a repeater to convert every date time would be too time consuming. I have to say though that the calculation column functionality is very neat.

Thanks,

Mona

Former Member
0 Kudos

Hi Mona,

Is your XacuteQuery time-sensitive? In otherwords, do you have transaction properties created for the query start date, end date, or both?

A time-sensitive query (such as a standard tag query) will allow you to use enable/disable the "Show Times in Server Time Zone" property of the iChart. It will also allow you to show the "Time Refresh" controls on the chart, and the date range will show on the buttons.

An XacuteQuery is not time-sensitive unless the "Start Date of Mapped Input" or "End Date of Mapped Input" (or both) are configured. When you configure these parameters, whatever date parameters are set on the Date Range tab of the XacuteQuery will be passed to the transaction. In the transaction, you could use these transaction properties further and link them into the tag query action's QueryStartDate and/or QueryEndDate parameters.

The effect is that the XacuteQuery becomes time-sensitive and then you should be able to display the correct times for the whatever timezone the client machine is in. Hopefully I am understanding your issue

Warm Regards,

Diana Hoppe

Former Member
0 Kudos

Hello,

I was actually able to resolve the issue using Mike's suggestion of using calculated columns without using a repeater. It works like a charm. Thank you both for taking the time to respond.

Regards,

Mona

Answers (0)