2.2.3.23 patternD

Menu Information

Column: Fill Column With: A set of Date Time values

Brief Information

Fill column with date/time data

Additional Information

Minimum Origin Version Required: 9.1 SR0


Command Line Usage

1.patternD display:=2 from:=2456717. to:=2456747. unit:=day; //generate date data in format of Mmm DD for each day from Mar 1st, 2014 to Mar 31st, 2014 and fill to the active column(s)

2.patternD irng:=[Book1]1!(1,3) format:=time display:=1 tfrom:=0.41666666666666669 tto:=0.625 inc:=30 unit:=min onerepeat:=3 seqrepeat:=2; //generate regular time data with format HH and fill to column 1 to 3 in Book1 Sheet1.

X-Function Execution Options

Please refer to the page for additional option switches when accessing the x-function from script

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input irng

Input

Range

<active>
Specifies the range of data columns you would like to fill values to.
Format format

Input

int

0
Specify the format of generated data.

Option list:

  • 0:Date
    The values in generated dataset will be date format.
  • 1:Time
    The values in generated dataset will be time format.
Display display

Input

int

0
Specify the display format of the date/time data. The option index number can be found from the drop-down list of Display in the patternD dialog box. Index number starts from 0.
Custom Display custom

Input

string

<unassigned>
This variable is only available when custom display is chosen for display(i.e. if format is date, display should be 21 and if format is time, display should be 17. This variable specifies the custom format of the date/time data. See the custom date format page for details.
From from

Input

double

<unassigned>
This variable is only available when the format is set to Date. It is used to specify the Julian date for the starting date of the generated sequence. When opening the dialog from the menu, the default value follows the current system date.
To to

Input

double

<unassigned>
This variable is only available when the format is set to Date. It is used to specify the Julian date for the ending date of the generated sequence. When opening the dialog from the menu, the default value is ten days after system date.
From tfrom

Input

double

<unassigned>
This variable is only available when the format is set to Time. It is used to specify the starting time of the generated sequence. Where 0 means 00:00 and 1 means 24:00. When opening the dialog from the menu, the default value is 00:00.
To tto

Input

double

<unassigned>
This variable is only available when the format is set to Time. It is used to specify the ending time of the generated sequence. Where 0 means 00:00 and 1 means 24:00. When opening the dialog from the menu, the default value is the current system time.
Increment inc

Input

double

1
Specify the increment within the generated data sequence. If the increment value is not an integer, it will be rounded to the next integer.
Increment Unit unit

Input

int

2
Specify the unit for the Increment value.

Option list:

  • sec:Second{0}
  • min:Minute{1}
  • hour:Hour{2}
  • day:Day{3}
  • week:Week{4}
  • mon:Month{5}
  • year:Year{6}
Mode mode

Input

int

0
Specify how the generated data should be arranged.

Option list:

  • 0:Repeat
  • The values in the generated data sequence will be filled to the selected column(s) by ascending/descending order (When Inc is positive, will be in ascending order; when it is negative, will be in descending order). It is also possible to define the repeat times for each value and the whole sequence(onerepeat and seqrepeat) in the generated dataset to determine the dataset size.
  • 1:Random
  • For each cell in the selected column, one value randomly picked from the generated data sequence will be filled into this cell. You can specify the value of size as the size of the generated dataset.
Repeat Times for Each Value onerepeat

Input

int

1
This variable is only controllable when the Mode variable is 0:Repeat. It specifies how many times each value repeats itself in the generated data sequence.
Repeat Times for The Sequence seqrepeat

Input

int

1
This variable is only controllable when the Mode variable is 0:Repeat. It specifies how many times each whole data sequence repeats itself in the generated dataset.
Total Number of Whole Set size

Input

int

10
This variable is only writable when the Mode variable is 1:Random. It specifies the total number of values in the whole dataset which will be generated based on the current setting.

Description

For GUI access of this function, see this help file.

Examples

  1. Create a new workbook with two columns.
  2. Highlight column A and run the following script:
    patternD format:=time display:=17 custom:="hh':'mm':'ss T" tfrom:=0.41666666666666669 tto:=26.458333333333332 inc:=30 unit:=min mode:=random size:=100;
    This fills the column A with time data of every half hour with custom format "hh':'mm':'ss T" from 10 A.M. to 10 P.M. on the system date, the fill is random and the dataset size is 100.
  3. Highlight column B and run the following script:
    patternD from:=2456658. to:=2457022. unit:=week;
    This fills the column B with date data of every week with format MM/dd/yyyy from 01/01/2014 to 12/31/2014


Related X-Functions

patternN, patternT