Blog Posts Process Management

Reusable, Simple, & Easy ISO Week Calculation with TIBCO Spotfire

Blog: The Tibco Blog

ISO is an international standard for representation of dates and times. It was issued by the International Organization for Standardization (ISO) and was first published in 1988. The most important purpose of this standard is to provide an unambiguous and well-defined method of representing dates and times, in order to avoid misinterpretation of numeric representations of dates and times, particularly when data transfer happens between countries with different conventions for writing numeric dates and times.

ISO week date is defined in Wikipedia as leap week calendar system. A date is specified by the ISO week-numbering year in the format YYYY, a week number in the format ww prefixed by the letter ‘W’, and the weekday number, a digit d from 1 through 7, beginning with Monday and ending with Sunday.

ISO week in TIBCO Spotfire

There are multiple ways to calculate ISO week in TIBCO Spotfire. Two simple and easy ways to perform this calculation are through data functions and expression functions.

Since this standard has been out since 1988, there are lots of pre-existing solutions for this calculation. One of the CRAN packages that can easily help is ISOWeek. Click here for detailed documentation about the package.

The first step requires installing the package ISOweek using TERR tools:

ISOweek_package

Once the package is installed, you can either use data functions or expressions to perform the calculation. In this example, ISOweek function defined in the package is used to calculate ISO week

ExpressionISOweek

ISOweek would be one of the available functions. Please note that it is a column function and return type is string.

You can also create a data function, which can add a new column to existing data table. Here is sample data function that appends a column to existing data in Spotfire.

ISOweek_DF

Both these methods result in additional column that is of type String.

ISOweekoutput

Want to try these tips and our other tricks for yourself in TIBCO Spotfire? Start a free Spotfire trial today.

Comments (1)

  1. This does not produce the correct ISO week. ISO weeks start on Monday and end on Sunday. 7/24/2010 was a Saturday and 7/25/2010 was a Sunday. 7/25 should still be part of ISO week 29.

Leave a Comment

Get the BPI Web Feed

Using the HTML code below, you can display this Business Process Incubator page content with the current filter and sorting inside your web site for FREE.

Copy/Paste this code in your website html code:

<iframe src="https://www.businessprocessincubator.com/content/reusable-simple-easy-iso-week-calculation-with-tibco-spotfire-2/?feed=html" frameborder="0" scrolling="auto" width="100%" height="700">

Customizing your BPI Web Feed

You can click on the Get the BPI Web Feed link on any of our page to create the best possible feed for your site. Here are a few tips to customize your BPI Web Feed.

Customizing the Content Filter
On any page, you can add filter criteria using the MORE FILTERS interface:

Customizing the Content Filter

Customizing the Content Sorting
Clicking on the sorting options will also change the way your BPI Web Feed will be ordered on your site:

Get the BPI Web Feed

Some integration examples

BPMN.org

XPDL.org

×