Custom Variables
  • 07 Dec 2022
  • PDF

Custom Variables

  • PDF

Article summary

Note

This is a machine-translated version of the original Japanese article.
Please understand that some of the information contained on this page may be inaccurate.

summary

When executing queries, path prefixes, and so on, you can insert specific strings and dates and times.

How it works

String substitution

  1. Select String as the type.
  2. Specify the characters enclosed in $ (for example, $variable$) as the variable name.
  3. Enter the string you want to replace in the value field.
  4. Save the custom variable.
  5. In the query or path prefix input field, enter the variable name where you want to insert the character.
  6. When the job runs, the values are substituted and executed.

Time and date substitution

  1. Select Time/Date (queuing) or Time /Date (Runtime) as the type. However, the time and date ( queuing) are the date and time at the time of queuing, and the time and date (at runtime) are used as the date and time at the time of execution.
  2. Specify the characters enclosed in $ (for example, $variable$) as the variable name.
  3. By specifying a value, unit, and before/after, you can change the value to be inserted relative to the queuing time or the date and time at run time.
  4. Specify the format.
  5. Specify the time zone.
  6. Save the custom variable.
  7. Embed the variable name in the query or path prefix input field where you want to insert the time and date.
  8. When the job runs, the values are substituted and executed.

Difference between queuing and runtime

If you select queuing, the date and time set by the user when transferring is the standard, and if you select the time of execution, the date and time when the job was actually executed will be based on the date and time.
For example, if you set the following when you run a job:
customvariables.png

If the execution date and time of this job is 2022-05-13 14:00:00 and the custom variable setting is Time / Date (queuing), the reference date and time will be 2022-05-13 15:00:00, and if the time / date (runtime) is set, the reference date and time will be 2022-05-13 14:00:00.
Similarly, when a schedule is set, the date and time set in the schedule function will be the standard date and time of the time / date (at the time of queuing), and the date and time when the transfer actually occurred will be the standard date and time of the time / date (at runtime).

Examples of use

Example of replacing a string in a path prefix setting

  1. Set the custom variable as shown below and press Save.
    image.png

  2. Next, write the following in the path prefix input field.

  3. When performing a transfer, the path prefix is executed as output/test_for_custom_variables.
    image.png

When using time and date (at runtime) in query settings

  1. If you want to use a date and time two days before the execution time for the query, set it as a custom variable as follows:
    image.png

  2. Next, write the following in the input field of the query.
    image.png

  3. If the date when the transfer was performed was 11/10/2019, the query isSELECT * FROM test_table WHERE date = "20191108" executed as .


Was this article helpful?