Altair® Panopticon

 

Adding an Action Date Picker

 

The Action Date Picker allows the entry of a Date/Time parameter.

Whenever the date picker value is changed, the associated action is executed.

Steps:

1.     After double-clicking or drawing a rectangle on the dashboard canvas, click  on the Select Part pane then click the Action Date Picker   icon.

The Action Date Picker pane is displayed, and the Action Date Picker part is added on the dashboard canvas with the current date and the Set button to the right.

For this example, the following parameters are defined:

Parameter Name

Type

Default Value

Ticker

Text

COST

TWS

Text

2008-01-01

TWE

Text

2009-03-01

SS

Text

2009-03-01

 

These parameters are used on the Title of the Line graph (e.g., Start: {TWS: yyyy-MMM-dd HH:mm:ss}, End = {TWE: yyyy-MMM-dd HH:mm:ss}, Snapshot: {SS: yyyy-MMM-dd HH:mm:ss}).

 

2.     The action date picker can be configured to either be a Standalone or a Form component.

When set to Form, the action date picker can be connected to any form controller on the same dashboard. The parameters that the action part can set depends on how the form is configured.

 

   NOTE

An action form part must be defined first to associate the action date picker as a component. Refer to Adding an Action Form more information.

 

A line connects the component to the associated form.

 

If the action date picker should not be connected to a form, it can be set to Standalone instead. Select the Target Parameter that will be updated by this action part.

 

3.     Enter the Title of the action date picker button.

4.     Select the Date/Time Format.

Clicking on the Date/Time box displays the date picker in calendar mode.

 

The text of the date can be directly entered, or alternatively it can be clicked on, to bring up a date picker in the Web client.

5.     Tap the Hide Button slider to turn it on. This means the action control will update the parameter whenever the value of the date picker changes.

6.     The Default to Today option is enabled by default. This allows the action date picker to check the current value of the dashboard parameter. If it is set to null/empty, an action is executed to update the parameter and trigger the loading of the parameterized data with the current date.

7.     Tap the Relative Date UTC Offset slider to turn it on then enter the UTC Offset value (default is +0000).

By default, when an action date picker performs a relative date calculation, the point in time that the calculation is relative to will be based on the time zone picked up from the browser (i.e., the timezone the user is in). Since parameters do not encode the time zone information, the resulting value from the relative date calculation will be affected by the time zone the relative calculation is performed in.

Example:

User timezone: UTC+0200

Expression: now

UTC Offset: none

Current time: 2001-01-01T00:00:00.000+0000

Evaluated time: 2001-01-01T02:00:00.000+0200

Parameter value: 2001-01-01T02:00:00.000

The now expression is evaluated in relation to the current time and when formatted, the time zone information is no longer encoding, resulting in a parameter value offset from UTC by +0200.

The UTC offset setting allows for configuring an offset from UTC for the time the calculation is relative to, independent of the timezone the user is in.

Example:

User timezone: UTC+0200

Expression: now

UTC Offset: +0600

Current time: 2001-01-01T00:00:00.000+0000

Evaluated time: 2001-01-01T02:00:00.000+0200

Parameter value: 2001-01-01T06:00:00.000

Since the UTC offset is +0600, the resulting parameter value is formatted with the offset from UTC rather than as the time zone the user is in.

This allows the parameter values generated by date pickers to target a specific UTC offset instead of generating values based on the time zone the user is currently in.

8.     Instead of turning the Default to Today slider on, enter the Default Relative Date String then click . This allows the relative date calculation (based on today’s date), by parsing the input text string.

This method uses the following pattern:

SIGN NUMBER UNIT

Where:

·         SIGN is either a ‘+’ or ‘-’

·         NUMBER is any number

·         UNIT which can be any of the following:

¨        m - minute

¨        H – hour

¨        D – day

¨        B – business day

¨        M – month

¨        Y – year

 

For example:

Pattern

Description

-5m

Back 5 minutes from current time.

-1D

Back 1 day from today.

+D

Forward 1 day from today.

-1B

Back 1 business day from today (ignore Saturday and Sunday).

+1B

Forward 1 business day from today (ignore Saturday and Sunday).

-1M

Back 1 month from today.

-1Y

Back 1 year from today.

-7D

Back 7 days from today.

-14D

Back 14 days from today.

 

When these values are entered, the correct date should be selected, and then the data requests are executed based on this date.

The special now term can also be used, this represents the current Date/Time. For example:

·         Using now will set the date picker to the current Date/Time

·         now-7D will set the date picker to 7 days ago. This is the same as specifying

-7D

For example:

 

The date will be now-7D by default.

For example, now is October 26, it will go back 7 days (October 19) and then the date will be recalculated along with the Date/Time format.

 

 

 

In addition, you can use the SIGN UNIT NUMBER pattern to modify the relative date calculation.

For example, if you enter -1M, the recalculated relative date will be September 26.

 

 

Complex expressions can also be entered to recalculate the relative date. These expressions are evaluated from the left to right pattern. The now term can also be used as a pointer to the currently evaluated value of the relative time expression.

For example, if you enter now-5M-2D+3Y in the Action Date Picker Settings pane:

 

The date will be now-5M-2D+3Y by default.

 

In the expression, you can also use startOf and endOf functions. Both functions take the same arguments, a relative time string, and a unit.

For example, if you enter startOf(now, D):

 

The date will display the start of the current day:

 

Lastly, you can define a complex expression with the functions. For example, if you enter startOf(now-7D, W):

 

The date will display the start of the previous week:

 

   NOTE

·           The Default Relative Date String will be used if the dashboard parameter is null/empty.

·           The relative Date/Time string is case sensitive.

 

9.     The Show quick-picks option is enabled by default. This allows you to select from pre-populated date ranges.

See to Selecting Relative Dates in Action Date Picker and Action Date Range Picker Controls for more information.

Tap the slider to turn off this option.

10.     The Display in PDF option is enabled by default. This allows you to include the action date picker in the PDF output. Tap the slider to turn this option off.

11.     To set the style of the Action Date Picker, click Style .

The page updates to display the Style pane.

 

See Defining the Style of General Parts for more information.

 

12.     Click Update Style  and select any of the following options:

·         Set current as default – Save the changes and set it as the default.

·         Create custom style – Save the changes and set it as a custom style.

The Style pane updates to display the Title control.

 

¨        Enter the custom style Title.

¨        If there are additional changes made, click Update Current Style in the Update Style drop-down.

The new custom style is added in the Workbook > Theme > Custom Styles list.

 

If published, the custom style configuration of the Action Date Picker will be added to the Global custom styles list and can be applied to other parts.

·         Reset to default – Revert to the original default settings.

13.   Click the Save  icon on the toolbar to save the changes.

When saved, the   notification is displayed.