0% found this document useful (0 votes)
16 views121 pages

Date1 Functions

something adasda sdas das d as da w e w e qwe q we a d a sd as dad something adasda sdas das d as da w e w e qwe q we a d a sd as dad something adasda sdas das d as da w e w e qwe q we a d a sd as dad something adasda sdas das d as da w e w e qwe q we a d a sd as dad something adasda sdas das d as da w e w e qwe q we a d a sd as dad something adasda sdas das d as da w e w e qwe q we a d a sd as dad asd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views121 pages

Date1 Functions

something adasda sdas das d as da w e w e qwe q we a d a sd as dad something adasda sdas das d as da w e w e qwe q we a d a sd as dad something adasda sdas das d as da w e w e qwe q we a d a sd as dad something adasda sdas das d as da w e w e qwe q we a d a sd as dad something adasda sdas das d as da w e w e qwe q we a d a sd as dad something adasda sdas das d as da w e w e qwe q we a d a sd as dad asd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 121

Date functions

You are an AI assistant tasked with generating proper JSON for a given
query using given list of functions function. Your goal is to interpret the
query and produce the appropriate JSON structure based on the
information provided.First, you will be given a list of context variables.
Then, you will receive a query. Your task is to generate the correct JSON
output for this query.

The context variables you can use are provided here:


<context_variables>

</context_variables>

All the functions definitions are given here, please use this to find
appropriate function and how to use it:
[
{
"nodeType": "Function",
"name": "DateInRange",
"displayName": "Date In Range",
"descriptions": [
"Returns true if the given date is between the given date range.
Ignores time"
],
"valueType": "Boolean",
"targetField": {
"fieldType": "Switch"
},
"category": "Date",
"arguments": [
{
"label": "date to find",
"valueTypes": [
{
"valueType": "Long",
"innerType": null
}
],
"fieldRenderer": {
"fieldType": "Date",
"attributeValues": {}
},
"argumentLength": "1"
},
{
"label": "date range",
"valueTypes": [
{
"valueType": "DateRange",
"innerType": null
}
],
"fieldRenderer": {
"fieldType": "DateRange",
"attributeValues": {}
},
"argumentLength": "1"
}
]
},
{
"nodeType": "Function",
"name": "DateRangesOverlaps",
"displayName": "Date Ranges Overlaps",
"descriptions": [
"Returns true if any given date is shared within the given date
ranges; otherwise, false. Ignores time"
],
"valueType": "Boolean",
"targetField": {
"fieldType": "Switch"
},
"category": "Date",
"arguments": [
{
"label": "date range 1",
"valueTypes": [
{
"valueType": "DateRange",
"innerType": null
}
],
"fieldRenderer": {
"fieldType": "DateRange",
"attributeValues": {}
},
"argumentLength": "1"
},
{
"label": "date range 2",
"valueTypes": [
{
"valueType": "DateRange",
"innerType": null
}
],
"fieldRenderer": {
"fieldType": "DateRange",
"attributeValues": {}
},
"argumentLength": "1"
}
]
},
{
"nodeType": "Function",
"name": "DateTimeInRange",
"displayName": "Date Time In Range",
"descriptions": [
"Returns true if the given date is between the given date range.
Including time"
],
"valueType": "Boolean",
"targetField": {
"fieldType": "Switch"
},
"category": "Date",
"arguments": [
{
"label": "date to check",
"valueTypes": [
{
"valueType": "Long",
"innerType": null
}
],
"fieldRenderer": {
"fieldType": "Date",
"attributeValues": {
"includeTimeOfDay": true
}
},
"argumentLength": "1"
},
{
"label": "date range",
"valueTypes": [
{
"valueType": "DateRange",
"innerType": null
}
],
"fieldRenderer": {
"fieldType": "DateTimeRange",
"attributeValues": {}
},
"argumentLength": "1"
}
]
},
{
"nodeType": "Function",
"name": "DateTimeRangesOverlaps",
"displayName": "Date Time Ranges Overlaps",
"descriptions": [
"Returns true if any given date is shared within the given date
ranges; otherwise, false. Including time"
],
"valueType": "Boolean",
"targetField": {
"fieldType": "Switch"
},
"category": "Date",
"arguments": [
{
"label": "date range 1",
"valueTypes": [
{
"valueType": "DateRange",
"innerType": null
}
],
"fieldRenderer": {
"fieldType": "DateTimeRange",
"attributeValues": {}
},
"argumentLength": "1"
},
{
"label": "date range 2",
"valueTypes": [
{
"valueType": "DateRange",
"innerType": null
}
],
"fieldRenderer": {
"fieldType": "DateTimeRange",
"attributeValues": {}
},
"argumentLength": "1"
}
]
},
{
"nodeType": "Function",
"name": "IsSubDateRange",
"displayName": "Is Sub Date Range",
"descriptions": [
"Checks weather the first date range is inside second date range"
],
"valueType": "Boolean",
"targetField": {
"fieldType": "Switch"
},
"category": "Date",
"arguments": [
{
"label": "arg1",
"valueTypes": [
{
"valueType": "DateRange",
"innerType": null
}
],
"fieldRenderer": {
"fieldType": "DateRange",
"attributeValues": {}
},
"argumentLength": "1"
},
{
"label": "arg2",
"valueTypes": [
{
"valueType": "DateRange",
"innerType": null
}
],
"fieldRenderer": {
"fieldType": "DateRange",
"attributeValues": {}
},
"argumentLength": "1"
}
]
},
{
"nodeType": "Function",
"name": "IsSubDateTimeRange",
"displayName": "Is Sub Date-Time Range",
"descriptions": [
"Checks weather the first date-time range is inside second date-
time range"
],
"valueType": "Boolean",
"targetField": {
"fieldType": "Switch"
},
"category": "Date",
"arguments": [
{
"label": "arg1",
"valueTypes": [
{
"valueType": "DateRange",
"innerType": null
}
],
"fieldRenderer": {
"fieldType": "DateTimeRange",
"attributeValues": {}
},
"argumentLength": "1"
},
{
"label": "arg2",
"valueTypes": [
{
"valueType": "DateRange",
"innerType": null
}
],
"fieldRenderer": {
"fieldType": "DateTimeRange",
"attributeValues": {}
},
"argumentLength": "1"
}
]
},
{
"nodeType": "Function",
"name": "CompareDates",
"displayName": "Compare Date",
"descriptions": [
"This formula compares the 2 input dates for equality based on
the input comparison criteria"
],
"valueType": "Boolean",
"targetField": {
"fieldType": "Switch"
},
"category": "Date",
"arguments": [
{
"label": "date1",
"valueTypes": [
{
"valueType": "Long",
"innerType": null
}
],
"fieldRenderer": {
"fieldType": "Date",
"attributeValues": {
"includeTimeOfDay": true
}
},
"argumentLength": "1"
},
{
"label": "date2",
"valueTypes": [
{
"valueType": "Long",
"innerType": null
}
],
"fieldRenderer": {
"fieldType": "Date",
"attributeValues": {
"includeTimeOfDay": true
}
},
"argumentLength": "1"
},
{
"label": "comparison criteria",
"valueTypes": [
{
"valueType": "Text",
"innerType": null
}
],
"fieldRenderer": {
"fieldType": "PickOne",
"attributeValues": {
"options": [
"Year",
"Month",
"Week",
"Day",
"Hour",
"Minute"
]
}
},
"argumentLength": "1"
},
{
"label": "start day of week",
"valueTypes": [
{
"valueType": "Text",
"innerType": null
}
],
"fieldRenderer": {
"fieldType": "PickOne",
"attributeValues": {
"options": [
"Sunday",
"Monday"
]
}
},
"argumentLength": "1"
}
]
},
{
"nodeType": "Function",
"name": "IsFutureDate",
"displayName": "Is Future Date",
"descriptions": [
"Returns true if the given date is a future date"
],
"valueType": "Boolean",
"targetField": {
"fieldType": "Switch"
},
"category": "Date",
"arguments": [
{
"label": "date",
"valueTypes": [
{
"valueType": "Long",
"innerType": null
}
],
"fieldRenderer": {
"fieldType": "Date",
"attributeValues": {}
},
"argumentLength": "1"
}
]
},
{
"nodeType": "Function",
"name": "IsPastDate",
"displayName": "Is Past Date",
"descriptions": [
"Returns true if the given date is a past date"
],
"valueType": "Boolean",
"targetField": {
"fieldType": "Switch"
},
"category": "Date",
"arguments": [
{
"label": "date",
"valueTypes": [
{
"valueType": "Long",
"innerType": null
}
],
"fieldRenderer": {
"fieldType": "Date",
"attributeValues": {}
},
"argumentLength": "1"
}
]
},
{
"nodeType": "Function",
"name": "IsPrecedingDate",
"displayName": "Is Preceding Date",
"descriptions": [
"Returns true if the first date is earlier than the second date"
],
"valueType": "Boolean",
"targetField": {
"fieldType": "Switch"
},
"category": "Date",
"arguments": [
{
"label": "date1",
"valueTypes": [
{
"valueType": "Long",
"innerType": null
}
],
"fieldRenderer": {
"fieldType": "Date",
"attributeValues": {}
},
"argumentLength": "1"
},
{
"label": "date2",
"valueTypes": [
{
"valueType": "Long",
"innerType": null
}
],
"fieldRenderer": {
"fieldType": "Date",
"attributeValues": {}
},
"argumentLength": "1"
}
]
},
{
"nodeType": "Function",
"name": "IsSubsequentDate",
"displayName": "Is Subsequent Date",
"descriptions": [
"Returns true if the first date is after the second date"
],
"valueType": "Boolean",
"targetField": {
"fieldType": "Switch"
},
"category": "Date",
"arguments": [
{
"label": "date1",
"valueTypes": [
{
"valueType": "Long",
"innerType": null
}
],
"fieldRenderer": {
"fieldType": "Date",
"attributeValues": {}
},
"argumentLength": "1"
},
{
"label": "date2",
"valueTypes": [
{
"valueType": "Long",
"innerType": null
}
],
"fieldRenderer": {
"fieldType": "Date",
"attributeValues": {}
},
"argumentLength": "1"
}
]
}

Also, arguments of function can come in two types: 1. Variable (When


we use variable from context_variables)and 2. Constant (When we use
constant value)Based on proper arguments use following structure:
For Variable use:
{
"type": "Variable",
"valueType": __,
"argLabel": __,
"children": __,
"scope": __,
"part": {__}
}
For Constant use:
{
"type": "Constant",
"valueType": __,
"argLabel": __,
"children": __,
"value": __
}

Your response should contain only the JSON output. Do not include any
explanations or additional text.
<query>
</query>

Here are some examples to guide you to understand what type of


output I need:

Date in Range
Example 1
Context Variables:
[
{“name”: ”Date of attendance”, “type”: “Date”},
{“name”: “Blockchain Event Dates”,”type”: “Date Range”}
{“name”: “Employee ID”,”type”: “Number”}
]
Query:
Check if the date of attendance was during the blockchain event
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date to find",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Date of attendance",
"part": null
}
},
{
"type": "Variable",
"valueType": "DateRange",
"argLabel": "date range",
"children": null,
"scope": "current",
"part": {
"type": "Object",
"valueType": "DateRange",
"name": "Blockchain Event Dates",
"part": null
}
}
],
"functionName": "DateInRange"
}
]
},
"dateMap": {}
}

Example 2
Query:
Check if October 1st 2024 is within the range January 1st 2024 to
December 22nd 2024
Answer:
{ “expression”:
{"type":"Expression","valueType":"?","argLabel":"arg1","children":
[{"type":"Function","valueType":"Boolean","argLabel":"arg1","children":
[{"type":"Constant","valueType":"Date","argLabel":"date to
find","children":null,"value":"DATE_!"},
{"type":"Constant","valueType":"DateRange","argLabel":"date
range","children":null,"value":
{"from":"DATE_2","to":"DATE_3","includeTime":false,"fromDisplayValue
":"2024-01-01","toDisplayValue":"2024-12-22","fromValue":"2024-01-
01","toValue":"2024-12-22"}}],"functionName":"DateInRange"}]},
“dateMap”: { “DATE_1”: “01-10-2024”, “DATE_2”: “01-01-2024”,
“DATE_3”: “22-12-2024”, } }

Example 3
Check if the date of attendance was during the Founders event
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date to find",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Date of attendance",
"part": null
}
},
{
"type": "Constant",
"valueType": "DateRange",
"argLabel": "date range",
"children": null,
"value": null
}
],
"functionName": "DateInRange"
}
]
},
"dateMap": {}
}
Date Ranges Overlap
Example 1
Context Variables:
[
{“name”: “AI Event Dates”,”type”: “Date Range”}
{“name”: “Blockchain Event Dates”,”type”: “Date Range”}
{“name”: “Employee ID”,”type”: “Number”}
]
Query:
Return True if the AI Event Dates overlaps with the Blockchain event
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "DateRange",
"argLabel": "date range 1",
"children": null,
"scope": "current",
"part": {
"type": "Object",
"valueType": "DateRange",
"name": "AI Event Dates",
"part": null
}
},
{
"type": "Variable",
"valueType": "DateRange",
"argLabel": "date range 2",
"children": null,
"scope": "current",
"part": {
"type": "Object",
"valueType": "DateRange",
"name": "Blockchain Event Dates",
"part": null
}
}
],
"functionName": "DateRangesOverlaps"
}
]
},
"dateMap": {}
}

Example 2
Context Variables:
[
{“name”: “AI Event Dates”,”type”: “Date Range”}
{“name”: “Blockchain Event Dates”,”type”: “Date Range”}
{“name”: “Employee ID”,”type”: “Number”}
]
Query:
Check if the date range August 1st 2024 - August 31st 2024 overlaps
with the date range June 6th 2024 - September 6th 2024
Answer:{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "DateRange",
"argLabel": "date range 1",
"children": null,
"value": {
"from": "DATE_1",
"to": "DATE_2",
"includeTime": false,
"fromDisplayValue": "2024-08-01",
"toDisplayValue": "2024-08-31",
"fromValue": "2024-08-01",
"toValue": "2024-08-31"
}
},
{
"type": "Constant",
"valueType": "DateRange",
"argLabel": "date range 2",
"children": null,
"value": {
"from": "DATE_3",
"to": "DATE_4",
"includeTime": false,
"fromDisplayValue": "2024-06-06",
"toDisplayValue": "2024-09-06",
"fromValue": "2024-06-06",
"toValue": "2024-09-06"
}
}
],
"functionName": "DateRangesOverlaps"
}
]
},
"dateMap": {
"DATE_1": "01-08-2024",
"DATE_2": "31-08-2024",
"DATE_3": "06-06-2024",
"DATE_4": "06-09-2024"
}
}

Example 3
Context Variables:
[
{“name”: “AI Event Dates”,”type”: “Date Range”}
{“name”: “Blockchain Event Dates”,”type”: “Date Range”}
{“name”: “Employee ID”,”type”: “Number”}
]
Query:
Check if the date range from 1st May 2024 to 31st May 2024 overlaps
with the date range from 20th May 2024 to 10th June 2024.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "DateRange",
"argLabel": "date range 1",
"children": null,
"value": {
"from": "DATE_1",
"to": "DATE_2",
"includeTime": false,
"fromDisplayValue": "2024-05-01",
"toDisplayValue": "2024-05-31",
"fromValue": "2024-05-01",
"toValue": "2024-05-31"
}
},
{
"type": "Constant",
"valueType": "DateRange",
"argLabel": "date range 2",
"children": null,
"value": {
"from": "DATE_3",
"to": "DATE_4",
"includeTime": false,
"fromDisplayValue": "2024-05-20",
"toDisplayValue": "2024-06-10",
"fromValue": "2024-05-20",
"toValue": "2024-06-10"
}
}
],
"functionName": "DateRangesOverlaps"
}
]
},
"dateMap": {
"DATE_1": "01-05-2024",
"DATE_2": "31-05-2024",
"DATE_3": "20-05-2024",
"DATE_4": "10-06-2024"
}
}

Example 4
Context Variables:
[
{“name”: “AI Event Dates”,”type”: “Date Range”}
{“name”: “Blockchain Event Dates”,”type”: “Date Range”}
{“name”: “Employee ID”,”type”: “Number”}
]
Query:
Check if date ranges overlap
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "DateRange",
"argLabel": "date range 1",
"children": null,
"value": null
},
{
"type": "Constant",
"valueType": "DateRange",
"argLabel": "date range 2",
"children": null,
"value": null
}
],
"functionName": "DateRangesOverlaps"
}
]
},
"dateMap": {}
}

Date time in Range


Example 1
Context Variables:
[
{“name”: ”Interview attendance date”, “type”: “Date”},
{“name”: “Candidate ID”,”type”: “Number”}
]
Query:
Check if the candidate attended an interview between 5th July 2024
3:00 PM to 19th July 2024 7:00 PM
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date to check",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Interview attendance date",
"part": null
}
},
{
"type": "Constant",
"valueType": "DateTimeRange",
"argLabel": "date range",
"children": null,
"value": {
"from": "DATE_1",
"to": "DATE_2",
"includeTime": true,
"fromDisplayValue": "2024-07-05 15:00",
"toDisplayValue": "2024-07-19 19:00",
"fromValue": "2024-07-05T15:00",
"toValue": "2024-07-19T19:00"
}
}
],
"functionName": "DateTimeInRange"
}
]
},
"dateMap": {
"DATE_1": "05-07-2024 03:00 PM",
"DATE_2": "19-07-2024 07:00 PM"
}
}
Example 2
[
{“name”: ”Interview attendance date”, “type”: “Date”},
{“name”: “Candidate ID”,”type”: “Number”}
]
Query:
Check if 3rd October 2024, 2:30 PM is within the date and time range
from 2nd October 2024, 9:00 AM to 4th October 2024, 6:00 PM.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date to check",
"children": null,
"value": "DATE_1"
},
{
"type": "Constant",
"valueType": "DateTimeRange",
"argLabel": "date range",
"children": null,
"value": {
"from": "DATE_2",
"to": "DATE_3",
"includeTime": true,
"fromDisplayValue": "2024-10-02 09:00",
"toDisplayValue": "2024-10-04 18:00",
"fromValue": "2024-10-02T09:00",
"toValue": "2024-10-04T18:00"
}
}
],
"functionName": "DateTimeInRange"
}
]
},
"dateMap": {
"DATE_1": "03-10-2024 02:30 PM",
"DATE_2": "02-10-2024 09:00 AM",
"DATE_3": "04-10-2024 06:00 PM"
}
}

Example 3
[
{“name”: ”Interview attendance date”, “type”: “Date”},
{“name”: “Candidate ID”,”type”: “Number”}
]
Query:
Check if IT Conference is within the date and time range from 2nd
October 2024, 9:00 AM to 4th October 2024, 6:00 PM.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date to check",
"children": null,
"value": null
},
{
"type": "Constant",
"valueType": "DateTimeRange",
"argLabel": "date range",
"children": null,
"value": {
"from": DATE_1,
"to": DATE_2,
"includeTime": true,
"fromDisplayValue": "2024-10-02 09:00",
"toDisplayValue": "2024-10-04 18:00",
"fromValue": "2024-10-02T09:00",
"toValue": "2024-10-04T18:00"
}
}
],
"functionName": "DateTimeInRange"
}
]
},
"dateMap": {
"DATE_1": "02-10-2024 9:00 AM",
"DATE_2": "04-10-2024 6:00 PM"
}
}

Date time Ranges Overlap


Example 1
Context Variables:
[
{“name”: “Series B Funding dates”,”type”: “Date Range”}
]
Query:
Check if the Series B funding dates clashes with the following date
range : 1st August 2024 9 AM to 15th August 2024 4 PM including
time.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "DateRange",
"argLabel": "date range 1",
"children": null,
"scope": "current",
"part": {
"type": "Object",
"valueType": "DateRange",
"name": "Series B Funding dates",
"part": null
}
},
{
"type": "Constant",
"valueType": "DateTimeRange",
"argLabel": "date range 2",
"children": null,
"value": {
"from": "DATE_1",
"to": "DATE_2",
"includeTime": true,
"fromDisplayValue": "2024-08-01 09:00",
"toDisplayValue": "2024-08-15 16:00",
"fromValue": "2024-08-01T09:00",
"toValue": "2024-08-15T16:00"
}
}
],
"functionName": "DateTimeRangesOverlaps"
}
]
},
"dateMap": {
"DATE_1": "01-08-2024 09:00 AM",
"DATE_2": "15-08-2024 04:00 PM"
}
}

Example 2
[
{“name”: “Series B Funding dates”,”type”: “Date Range”}
]
Query:
Check if the date and time range from 15th August 2024, 10:00 AM to
15th August 2024, 2:00 PM overlaps with the date and time range from
15th August 2024, 1:00 PM to 15th August 2024, 5:00 PM.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "DateTimeRange",
"argLabel": "date range 1",
"children": null,
"value": {
"from": "DATE_1",
"to": "DATE_2",
"includeTime": true,
"fromDisplayValue": "2024-08-15 10:00",
"toDisplayValue": "2024-08-15 14:00",
"fromValue": "2024-08-15T10:00",
"toValue": "2024-08-15T14:00"
}
},
{
"type": "Constant",
"valueType": "DateTimeRange",
"argLabel": "date range 2",
"children": null,
"value": {
"from": "DATE_3",
"to": "DATE_4",
"includeTime": true,
"fromDisplayValue": "2024-08-15 13:00",
"toDisplayValue": "2024-08-15 17:00",
"fromValue": "2024-08-15T13:00",
"toValue": "2024-08-15T17:00"
}
}
],
"functionName": "DateTimeRangesOverlaps"
}
]
},
"dateMap": {
"DATE_1": "15-08-2024 10:00 AM",
"DATE_2": "15-08-2024 02:00 PM",
"DATE_3": "15-08-2024 01:00 PM",
"DATE_4": "15-08-2024 05:00 PM"
}
}

Example 3
Context Variables:
[
{“name”: “Series B Funding dates”,”type”: “Date Range”}
]
Query:
Check if the Series A funding dates clashes with Series B Funding
dates.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "DateTimeRange",
"argLabel": "date range 1",
"children": null,
"value": null
},
{
"type": "Variable",
"valueType": "DateRange",
"argLabel": "date range 2",
"children": null,
"scope": "current",
"part": {
"type": "Object",
"valueType": "DateRange",
"name": "Series B Funding dates",
"part": null
}
}
],
"functionName": "DateTimeRangesOverlaps"
}
]
},
"dateMap": {}
}

Is Sub Date Range


Example 1
Context Variables:
[
{"name": "Requested Leave Date Range", "type": "Date Range"},
{"name": "Allowed Leave Date Range", "type": "Date Range"}
]
Query
Check if the requested leave date range falls within the allowed leave
date range.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "DateRange",
"argLabel": "arg1",
"children": null,
"scope": "current",
"part": {
"type": "Object",
"valueType": "DateRange",
"name": "Requested Leave Date Range",
"part": null
}
},
{
"type": "Variable",
"valueType": "DateRange",
"argLabel": "arg2",
"children": null,
"scope": "current",
"part": {
"type": "Object",
"valueType": "DateRange",
"name": "Allowed Leave Date Range",
"part": null
}
}
],
"functionName": "IsSubDateRange"
}
]
},
"dateMap": {}
}

Example 2
Context Variables:
[
{"name": "Requested Leave Date Range", "type": "Date Range"},
{"name": "Allowed Leave Date Range", "type": "Date Range"}
]
Query
Check if the date range from 1st September 2024 to 10th September
2024 is completely within the date range from 1st August 2024 to 30th
September 2024.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "DateRange",
"argLabel": "arg1",
"children": null,
"value": {
"from": "DATE_1",
"to": "DATE_2",
"includeTime": false,
"fromDisplayValue": "2024-09-01",
"toDisplayValue": "2024-09-10",
"fromValue": "2024-09-01",
"toValue": "2024-09-10"
}
},
{
"type": "Constant",
"valueType": "DateRange",
"argLabel": "arg2",
"children": null,
"value": {
"from": "DATE_3",
"to": "DATE_4",
"includeTime": false,
"fromDisplayValue": "2024-08-01",
"toDisplayValue": "2024-09-30",
"fromValue": "2024-08-01",
"toValue": "2024-09-30"
}
}
],
"functionName": "IsSubDateRange"
}
]
},
"dateMap": {
"DATE_1": "01-09-2024",
"DATE_2": "10-09-2024",
"DATE_3": "01-08-2024",
"DATE_4": "30-09-2024"
}
}

Example 3
Context Variables:
[
{"name": "Requested Leave Date Range", "type": "Date Range"},
{"name": "Allowed Leave Date Range", "type": "Date Range"}
]
Query
Check if the Summer Fest date range is a sub date range of 1st August
2024 to 30th September 2024.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "DateRange",
"argLabel": "arg1",
"children": null,
"value": null
},
{
"type": "Constant",
"valueType": "DateRange",
"argLabel": "arg2",
"children": null,
"value": {
"from": DATE_1,
"to": DATE_2,
"includeTime": false,
"fromDisplayValue": "2024-08-01",
"toDisplayValue": "2024-09-30",
"fromValue": "2024-08-01",
"toValue": "2024-09-30"
}
}
],
"functionName": "IsSubDateRange"
}
]
},
"dateMap": {
"DATE_1": "01-08-2024",
"DATE_2": "30-09-2024"
}
}
Is Sub Date-Time Range
Example 1
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date-Time Range”},
{"name": “Office Hours, "type": "Date-Time Range”}
]
Query:
Check if the meeting slot falls within the office hours.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "DateRange",
"argLabel": "arg1",
"children": null,
"scope": "current",
"part": {
"type": "Object",
"valueType": "DateRange",
"name": "Meeting Slot",
"part": null
}
},
{
"type": "Variable",
"valueType": "DateRange",
"argLabel": "arg2",
"children": null,
"scope": "current",
"part": {
"type": "Object",
"valueType": "DateRange",
"name": "Office Hours",
"part": null
}
}
],
"functionName": "IsSubDateTimeRange"
}
]
},
"dateMap": {}
}

Example 2
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date-Time Range”},
{"name": “Office Hours, "type": "Date-Time Range”}
]
Query:
Check if the date-time range from 10th October 2024, 3:00 PM to 10th
October 2024, 6:00 PM is completely within the date-time range from
10th October 2024, 9:00 AM to 10th October 2024, 9:00 PM.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "DateTimeRange",
"argLabel": "arg1",
"children": null,
"value": {
"from": "DATE_1",
"to": "DATE_2",
"includeTime": true,
"fromDisplayValue": "2024-10-10 15:00",
"toDisplayValue": "2024-10-10 18:00",
"fromValue": "2024-10-10T15:00",
"toValue": "2024-10-10T18:00"
}
},
{
"type": "Constant",
"valueType": "DateTimeRange",
"argLabel": "arg2",
"children": null,
"value": {
"from": "DATE_3",
"to": "DATE_4",
"includeTime": true,
"fromDisplayValue": "2024-10-10 09:00",
"toDisplayValue": "2024-10-10 21:00",
"fromValue": "2024-10-10T09:00",
"toValue": "2024-10-10T21:00"
}
}
],
"functionName": "IsSubDateTimeRange"
}
]
},
"dateMap": {
"DATE_1": "10-10-2024 03:00 PM",
"DATE_2": "10-10-2024 06:00 PM",
"DATE_3": "10-10-2024 09:00 AM",
"DATE_4": "10-10-2024 09:00 PM"
}
}

Example 3
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date-Time Range”},
{"name": “Office Hours, "type": "Date-Time Range”}
]
Query:
Check if the date-time range is a sub date-time range of
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "DateTimeRange",
"argLabel": "arg1",
"children": null,
"value": null
},
{
"type": "Constant",
"valueType": "DateTimeRange",
"argLabel": "arg2",
"children": null,
"value": null
}
],
"functionName": "IsSubDateTimeRange"
}
]
},
"dateMap": {}
}

Is Future Date
Example 1
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date”},
{"name": “Holiday List, "type": "Date Range”},
{"name": “Holiday List, "type": "Date-Time Range”},
{“name": “Sales Date”, "type": "Date”},
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date"},
{"name": “Epoch Time”, "type": “Number”}
]
Query:
Check if the Project End Date is a future date or not.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Project End Date",
"part": null
}
}
],
"functionName": "IsFutureDate"
}
]
},
"dateMap": {}
}
Example 2
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date”},
{"name": “Holiday List, "type": "Date Range”},
{"name": “Holiday List, "type": "Date-Time Range”},
{“name": “Sales Date”, "type": "Date”},
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date"},
{"name": “Epoch Time”, "type": “Number”}
]
Query:
Check if 1st January 2025 is a future date compared to today's date.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date",
"children": null,
"value": "DATE_1"
}
],
"functionName": "IsFutureDate"
}
]
},
"dateMap": {
"DATE_1": "01-01-2025"
}
}

Example 3
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date”},
{"name": “Holiday List, "type": "Date Range”},
{"name": “Holiday List, "type": "Date-Time Range”},
{“name": “Sales Date”, "type": "Date”},
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date"},
{"name": “Epoch Time”, "type": “Number”}
]
Query:
Check if NASA Launch date is a future date compared to today's date.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date",
"children": null,
"value": null
}
],
"functionName": "IsFutureDate"
}
]
},
"dateMap": {}
}
Is Past Date
Example 1
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date”},
{"name": “Holiday List, "type": "Date Range”},
{"name": “Holiday List, "type": "Date-Time Range”},
{“name": “Project Deadline”, "type": "Date”},
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date"},
{"name": “Epoch Time”, "type": “Number”}
]
Query:
Check if we have already passed the Project Deadline.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Project Deadline",
"part": null
}
}
],
"functionName": "IsPastDate"
}
]
},
"dateMap": {}
}

Example 2
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date”},
{"name": “Holiday List, "type": "Date Range”},
{"name": “Holiday List, "type": "Date-Time Range”},
{“name": “Project Deadline”, "type": "Date”},
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date"},
{"name": “Epoch Time”, "type": “Number”}
]
Query:
Check if 15th July 2023 is a past date compared to today's date.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date",
"children": null,
"value": "DATE_1"
}
],
"functionName": "IsPastDate"
}
]
},
"dateMap": {
"DATE_1": "15-07-2023"
}
}

Example 3
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date”},
{"name": “Holiday List, "type": "Date Range”},
{"name": “Holiday List, "type": "Date-Time Range”},
{“name": “Project Deadline”, "type": "Date”},
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date"},
{"name": “Epoch Time”, "type": “Number”}
]
Query:
Check if is past date.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date",
"children": null,
"value": null
}
],
"functionName": "IsPastDate"
}
]
},
"dateMap": {}
}

Is Preceding Date
Example 1
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date”},
{"name": “Holiday List, "type": "Date Range”},
{"name": “Holiday List, "type": "Date-Time Range”},
{“name": “Project Deadline”, "type": "Date”},
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date"},
{"name": “Epoch Time”, "type": “Number”}
]
Query:
Check if the Project start date comes before the end date.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date1",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Project Start Date",
"part": null
}
},
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date2",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Project End Date",
"part": null
}
}
],
"functionName": "IsPrecedingDate"
}
]
},
"dateMap": {}
}

Example 2
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date”},
{"name": “Holiday List, "type": "Date Range”},
{"name": “Holiday List, "type": "Date-Time Range”},
{“name": “Project Deadline”, "type": "Date”},
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date"},
{"name": “Epoch Time”, "type": “Number”}
]
Query:
Check if 5th March 2023 is earlier than 10th March 2023.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date1",
"children": null,
"value": "DATE_1"
},
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date2",
"children": null,
"value": "DATE_2"
}
],
"functionName": "IsPrecedingDate"
}
]
},
"dateMap": {
"DATE_1": "05-03-2023",
"DATE_2": "10-03-2023"
}
}

Example 3
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date”},
{"name": “Holiday List, "type": "Date Range”},
{"name": “Holiday List, "type": "Date-Time Range”},
{“name": “Project Deadline”, "type": "Date”},
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date"},
{"name": “Epoch Time”, "type": “Number”}
]
Query:
Check if Meeting date is earlier than 10th March 2023.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date1",
"children": null,
"value": null
},
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date2",
"children": null,
"value": DATE_1
}
],
"functionName": "IsPrecedingDate"
}
]
},
"dateMap": {
"DATE_1": "10-03-2023"
}
}

Is Subsequent Date
Example 1
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date”},
{"name": “Holiday List, "type": "Date Range”},
{"name": “Holiday List, "type": "Date-Time Range”},
{“name": “Project Deadline”, "type": "Date”},
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date"},
{"name": “Epoch Time”, "type": “Number”}
]
Query:
Check if the Project Deadline comes after the Project End Date
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date1",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Project Deadline",
"part": null
}
},
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date2",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Project End Date",
"part": null
}
}
],
"functionName": "IsSubsequentDate"
}
]
},
"dateMap": {}
}

Example 2
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date”},
{"name": “Holiday List, "type": "Date Range”},
{"name": “Holiday List, "type": "Date-Time Range”},
{“name": “Project Deadline”, "type": "Date”},
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date"},
{"name": “Epoch Time”, "type": “Number”}
]
Query:
Check if 20th April 2024 is after 15th April 2024.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date1",
"children": null,
"value": "DATE_1"
},
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date2",
"children": null,
"value": "DATE_2"
}
],
"functionName": "IsSubsequentDate"
}
]
},
"dateMap": {
"DATE_1": "20-04-2024",
"DATE_2": "15-04-2024"
}
}

Example 3
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date”},
{"name": “Holiday List, "type": "Date Range”},
{"name": “Holiday List, "type": "Date-Time Range”},
{“name": “Project Deadline”, "type": "Date”},
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date"},
{"name": “Epoch Time”, "type": “Number”}
]
Query:
Check if the Sales date comes after the Company IPO
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date1",
"children": null,
"value": null
},
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date2",
"children": null,
"value": null
}
],
"functionName": "IsSubsequentDate"
}
]
},
"dateMap": {}
}

AddSubtractWorkDays

Example 1
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date”},
{"name": “Holiday List, "type": "Date Range”},
{"name": “Holiday List, "type": "Date-Time Range”},
{“name": “Project Deadline”, "type": "Date”},
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date"},
{"name": “Epoch Time”, "type": “Number”},
]
Query:
Add 4 working days to Project Start date where the non working days
are Saturday and Sunday
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Long",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "start date",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Project Start Date",
"part": null
}
},
{
"type": "Constant",
"valueType": "PickOne",
"argLabel": "add/subtract",
"children": null,
"value": "Add"
},
{
"type": "Constant",
"valueType": "Number",
"argLabel": "value",
"children": null,
"value": 4
},
{
"type": "Constant",
"valueType": "Checkboxes",
"argLabel": "non working days",
"children": null,
"value": ["Saturday", "Sunday"]
}
],
"functionName": "AddSubtractWorkDays"
}
]
},
"dateMap": {}
}

Example 2
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date”},
{"name": “Holiday List, "type": "Date Range”},
{"name": “Holiday List, "type": "Date-Time Range”},
{“name": “Project Deadline”, "type": "Date”},
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date"},
{"name": “Epoch Time”, "type": “Number”},
]
Query:
Subtract 6 working days from 10th October 2024
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Long",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "start date",
"children": null,
"value": "DATE_1"
},
{
"type": "Constant",
"valueType": "PickOne",
"argLabel": "add/subtract",
"children": null,
"value": "Subtract"
},
{
"type": "Constant",
"valueType": "Number",
"argLabel": "value",
"children": null,
"value": 6
},
{
"type": "Constant",
"valueType": "Checkboxes",
"argLabel": "non working days",
"children": null,
"value": null
}
],
"functionName": "AddSubtractWorkDays"
}
]
},
"dateMap": {
"DATE_1": "10-10-2024"
}
}

Example 3
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date”},
{"name": “Holiday List, "type": "Date Range”},
{"name": “Holiday List, "type": "Date-Time Range”},
{“name": “Project Deadline”, "type": "Date”},
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date"},
{"name": “Epoch Time”, "type": “Number”},
]
Query:
Add 1 working day to Company IPO Date.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Long",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "start date",
"children": null,
"value": null
},
{
"type": "Constant",
"valueType": "PickOne",
"argLabel": "add/subtract",
"children": null,
"value": "Add"
},
{
"type": "Constant",
"valueType": "Number",
"argLabel": "value",
"children": null,
"value": 1
},
{
"type": "Constant",
"valueType": "Checkboxes",
"argLabel": "non working days",
"children": null,
"value": null
}
],
"functionName": "AddSubtractWorkDays"
}
]
},
"dateMap": {}
}

DateToMonth
Example 1
Context variables
[
{“name”: ”Appointment Date”, “type”: “Date”},
{“name”: “Patient Name”,”type”: “Text”}
]Query:
Get the current month.
Answer:
{"type":"Expression","valueType":"?","argLabel":"arg1","children":
[{"type":"Function","valueType":"Text","argLabel":"arg1","children":null
,"functionName":"DateToMonth"}]}

Example 2
Context variables
[
{“name”: ”Appointment Date”, “type”: “Date”},
{“name”: “Patient Name”,”type”: “Text”}
]Query:
What month is this?.
Answer:
{"type":"Expression","valueType":"?","argLabel":"arg1","children":
[{"type":"Function","valueType":"Text","argLabel":"arg1","children":null
,"functionName":"DateToMonth"}]}

Add to date
Example 1
Context Variables:
[
{“name”: ”Appointment Date”, “type”: “Date”},
{“name”: “Patient Name”,”type”: “Text”}
]
Query:
Postpone the appointment date by 1 week
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Long",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Appointment Date",
"part": null
}
},
{
"type": "Constant",
"valueType": "PickOne",
"argLabel": "options",
"children": null,
"value": "Weeks"
},
{
"type": "Constant",
"valueType": "Number",
"argLabel": "value to add",
"children": null,
"value": 1
}
],
"functionName": "AddToDate"
}
]
},
"dateMap": {}
}

Example 2
Context Variables:
[
{“name”: ”Appointment Date”, “type”: “Date”},
{“name”: “Patient Name”,”type”: “Text”}
]
Query:
Postpone Manager one on one by 2 days
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Long",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date",
"children": null,
"value": null
},
{
"type": "Constant",
"valueType": "PickOne",
"argLabel": "options",
"children": null,
"value": "Days"
},
{
"type": "Constant",
"valueType": "Number",
"argLabel": "value to add",
"children": null,
"value": 2
}
],
"functionName": "AddToDate"
}
]
},
"dateMap": {}
}

Example 3
Context Variables:
[
{“name”: ”Appointment Date”, “type”: “Date”},
{“name”: “Patient Name”,”type”: “Text”},
{“name”: ” Employee Appraisal date”, “type”: “Date”},
]
Query:
Add 1 to the Employee Appraisal date.
Answer:{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Long",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Employee Appraisal Date",
"part": null
}
},
{
"type": "Constant",
"valueType": "PickOne",
"argLabel": "options",
"children": null,
"value": null
},
{
"type": "Constant",
"valueType": "Number",
"argLabel": "value to add",
"children": null,
"value": 1
}
],
"functionName": "AddToDate"
}
]
},
"dateMap": {}
}

Example 3
Context Variables:
[
{“name”: ”Appointment Date”, “type”: “Date”},
{“name”: “Patient Name”,”type”: “Text”},
{“name”: ” Employee Appraisal date”, “type”: “Date”},
]
Query:
Add 3 months to 3rd October 2024
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Long",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date",
"children": null,
"value": "DATE_1"
},
{
"type": "Constant",
"valueType": "PickOne",
"argLabel": "options",
"children": null,
"value": "Months"
},
{
"type": "Constant",
"valueType": "Number",
"argLabel": "value to add",
"children": null,
"value": 3
}
],
"functionName": "AddToDate"
}
]
},
"dateMap": {
"DATE_1": "03-10-2024"
}
}

SubtractFromDate
Example 1
Context Variables:
[
{“name”: ”Appointment Date”, “type”: “Date”},
{“name”: “Candidate ID”,”type”: “Text”}
]
Query:
Subtract 1 week from the Appointment Date
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Long",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Appointment Date",
"part": null
}
},
{
"type": "Constant",
"valueType": "PickOne",
"argLabel": "options",
"children": null,
"value": “Weeks”
},
{
"type": "Constant",
"valueType": "Number",
"argLabel": "value to subtract",
"children": null,
"value": 1
}
],
"functionName": "SubtractFromDate"
}
]
},
"dateMap": {}
}

CurrentDate
Example 1
Context Variables:
[
{“name”: ”Date of attending meeting”, “type”: “Date”},
{“name”: “Candidate ID”,”type”: “Text”}
]
Query:
Show the present date.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Long",
"argLabel": "arg1",
"children": null,
"functionName": "CurrentDate"
}
]
},
"dateMap": {}
}

StringToDate
Example 1
Context Variables:
[
{“name”: ”Date of attending meeting”, “type”: “Date”},
{“name”: “Candidate ID”,”type”: “Text”}
]
Query:
Convert the text “19th May 1998” to a valid date.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Long",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Text",
"argLabel": "arg1",
"children": null,
"value": "19th May 1998"
}
],
"functionName": "StringToDate"
}
]
},
"dateMap": {}
}

Example 2
Context Variables:
[
{“name”: ”Date of attending meeting”, “type”: “Date”},
{“name”: “Candidate ID”,”type”: “Text”},
{“name”: “Birthday”,”type”: “Text”}
]
Query:
Convert birthday to a valid date.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Long",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Text",
"argLabel": "arg1",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Text",
"name": "Birthday",
"part": null
}
}
],
"functionName": "StringToDate"
}
]
},
"dateMap": {}
}

CurrentTime
Context Variables:
[
{“name”: ”Name”, “type”: “Text”},
{“name”: “Roll no”,”type”: “Number”}
]
Query:
Show the current time.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Long",
"argLabel": "arg1",
"children": null,
"functionName": "CurrentTime"
}
]
},
"dateMap": {}
}

DateToString
Example 1
Context Variables:
[
{“name”: ”Meeting Date”, “type”: “Date”},
{“name”: “Employee ID”,”type”: “Number”}
]
Query:
Convert Meeting Date to text and display it in a dd/mm/yyyy format in
US/Pacific timezone. Make sure to show the timezone swell.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Text",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Text",
"argLabel": "format",
"children": null,
"value": "dd/mm/yyyy"
},
{
"type": "Constant",
"valueType": "PickOne",
"argLabel": "timezone",
"children": null,
"value": "US/Pacific"
},
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Meeting Date",
"part": null
}
},
{
"type": "Constant",
"valueType": "Switch",
"argLabel": "display timezone",
"children": null,
"value": true
}
],
"functionName": "DateToString"
}
]
},
"dateMap": {
}
}

Example 2
Context Variables:
[
{“name”: ”Meeting Date”, “type”: “Date”},
{“name”: “Employee ID”,”type”: “Number”}
]
Query:
Convert 10th May 2024 to text and display it in a dd/mm/yyyy format.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Text",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Text",
"argLabel": "format",
"children": null,
"value": "dd/mm/yyyy"
},
{
"type": "Constant",
"valueType": "PickOne",
"argLabel": "timezone",
"children": null,
"value": null
},
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date",
"children": null,
"value": "DATE_1"
},
{
"type": "Constant",
"valueType": "Switch",
"argLabel": "display timezone",
"children": null,
"value": null
}
],
"functionName": "DateToString"
}
]
},
"dateMap": {
"DATE_1": “10-05-2024"
}
}

Example 3
Context Variables:
[
{“name”: ”Meeting Date”, “type”: “Date”},
{“name”: “Employee ID”,”type”: “Number”}
]
Query:
Convert Product Launch Date to text.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Text",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Text",
"argLabel": "format",
"children": null,
"value": null
},
{
"type": "Constant",
"valueType": "PickOne",
"argLabel": "timezone",
"children": null,
"value": null
},
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date",
"children": null,
"value": null
},
{
"type": "Constant",
"valueType": "Switch",
"argLabel": "display timezone",
"children": null,
"value": null
}
],
"functionName": "DateToString"
}
]
},
"dateMap": {}
}

DateToAge
Example 1
Context Variables:
[
{“name”: ”Name”, “type”: “Text”},
{“name”: “DOB”,”type”: “Date”},
{“name”: “ID”,”type”: “Number”}
]
Query:
What is my age? My birthday is on DOB.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "DOB",
"part": null
}
}
],
"functionName": "DateToAge"
}
]
},
"dateMap": {
}
}

Example 2
Context Variables:
[
{“name”: ”Name”, “type”: “Text”},
{“name”: “DOB”,”type”: “Date”},
{“name”: “ID”,”type”: “Number”}
]
Query:
If I was born on 10-08-1998 (dd-mm-yyyy), how old am I?
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date",
"children": null,
"value": "DATE_1"
}
],
"functionName": "DateToAge"
}
]
},
"dateMap": {
"DATE_1": “10-08-2024"
}
}

Example 3
Context Variables:
[
{“name”: ”Name”, “type”: “Text”},
{“name”: “ID”,”type”: “Number”}
]
Query:
Convert Son’s Birthday to age.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date",
"children": null,
"value": null
}
],
"functionName": "DateToAge"
}
]
},
"dateMap": {}
}

DaysBetween
Example 1
Context Variables:
[
{"name": "Project start date", "type": "Date"},
{"name": "Project end date", "type": "Date"}
]
Query:
Calculate the number of days between Project Start Date and the
Project End Date.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Project start date",
"part": null
}
},
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Project end date",
"part": null
}
}
],
"functionName": "DaysBetween"
}
]
},
"dateMap": {}
}

Example 2
Context Variables:
[
{"name": "Project start date", "type": "Date"},
{"name": "Project end date", "type": "Date"}
]
Query:
Calculate the number of days between 3rd March 2024 and the Project
End Date.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date",
"children": null,
"value": "DATE_1"
},
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Project End Date",
"part": null
}
}
],
"functionName": "DaysBetween"
}
]
},
"dateMap": {
"DATE_1": “03-03-2024"
}
}

DaysInDateRange
Example 1
Context Variables:
[
{"name": “Holiday list, "type": "Date Range},
{"name": “Year”, "type": “Number”},
]
Query:
Calculate how many days are in the holiday list.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "DateRange",
"argLabel": "date range",
"children": null,
"scope": "current",
"part": {
"type": "Object",
"valueType": "DateRange",
"name": "Holiday List",
"part": null
}
}
],
"functionName": "DaysInRange"
}
]
},
"dateMap": {}
}

Example 2
Context Variables:
[
{"name": “Holiday list, "type": "Date Range},
{"name": “Year”, "type": “Number”},
]
Query:
Calculate how many days are in the Conference Dates.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "DateRange",
"argLabel": "date range",
"children": null,
"value": null
}
],
"functionName": "DaysInRange"
}
]
},
"dateMap": {}
}

Example 3
Context Variables:
[
{"name": “Holiday list, "type": "Date Range},
{"name": “Year”, "type": “Number”},
]
Query:
Calculate how many days are in the range 10-03-2023 to 13-01-2024
(dd-mm-yyyy)
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "DateRange",
"argLabel": "date range",
"children": null,
"value": {
"from": "DATE_1",
"to": "DATE_2",
"includeTime": false,
"fromDisplayValue": "2023-03-10",
"toDisplayValue": "2024-01-13",
"fromValue": "2023-03-10",
"toValue": "2024-01-13"
}
}
],
"functionName": "DaysInRange"
}
]
},
"dateMap": {
"DATE_1": "10-03-2023",
"DATE_2": "13-01-2024"
}
}

FirstDayOfMonth
Example 1
Context Variables:
[
"name": "Invoice Date", "type": "Date"}
]
Query:
Find the first day of the month for the given invoice date.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Long",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Invoice Date",
"part": null
}
}
],
"functionName": "FirstDayOfMonth"
}
]
},
"dateMap": {}
}

Example 2
Context Variables:
[
"name": "Invoice Date", "type": "Date"}
]
Query:
Find the first day of the month for 23rd March 2023.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Long",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date",
"children": null,
"value": "DATE_1"
}
],
"functionName": "FirstDayOfMonth"
}
]
},
"dateMap": {
"DATE_1": "23-03-2023"
}
}

Example 3
Context Variables:
[
"name": "Invoice Date", "type": "Date"}
]
Query:
Find the first day of the month for
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Long",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date",
"children": null,
"value": null
}
],
"functionName": "FirstDayOfMonth"
}
]
},
"dateMap": {}
}

FirstDayOfWeek
Example 1
Context Variables:
[
{“name": “Meeting Date", "type": "Date”},
{"name": “Holiday list, "type": "Date Range”}
]
Query:
Find the first day of the week for the given meeting date.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Long",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "arg1",
"children": null,
"value": null
}
],
"functionName": "FirstDayOfWeek"
}
]
},
"dateMap": {}
}

Hours
Example 1
Context Variables:
[
{"name": “Company All Hands, "type": "Date"}
]
Query:
Retrieve the hour component from Company All Hands meeting.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "arg1",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Company All Hands",
"part": null
}
}
],
"functionName": "Hours"
}
]
},
"dateMap": {}
}

Example 2
Context Variables:
[
{"name": “Company All Hands, "type": "Date"}
]
Query:
Retrieve the hours component of a date.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "arg1",
"children": null,
"value": null
}
],
"functionName": "Hours"
}
]
},
"dateMap": {}
}

LastDayOfMonth
Example 1
Context Variables:
[
{"name": "Billing Date", "type": "Date"}
]
Query:
Find the last day of the month for the given billing date.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Long",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "arg1",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Billing Date",
"part": null
}
}
],
"functionName": "LastDayOfMonth"
}
]
},
"dateMap": {}
}

Example 2
Context Variables:
[
{"name": "Billing Date", "type": "Date"}
]
Query:
Find the last day of the month for the Project End Date.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Long",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "arg1",
"children": null,
"value": null
}
],
"functionName": "LastDayOfMonth"
}
]
},
"dateMap": {}
}

LastDayOfWeek
Example 1
Context Variables:
[
{"name": "Report Date", "type": "Date"}
{“name": “Meeting Slot”, "type": "Date-Time Range”},
{"name": “Office Hours, "type": "Date-Time Range”}
]
Query:
Find the last day of the week for the given report date.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Long",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "arg1",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Report Date",
"part": null
}
}
],
"functionName": "LastDayOfWeek"
}
]
},
"dateMap": {}
}

Example 2
Context Variables:
[
{"name": "Report Date", "type": "Date"}
{“name": “Meeting Slot”, "type": "Date-Time Range”},
{"name": “Office Hours, "type": "Date-Time Range”}
]
Query:
Find the last day of the week for the 10th of March 2024.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Long",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "arg1",
"children": null,
"value": "DATE_1"
}
],
"functionName": "LastDayOfWeek"
}
]
},
"dateMap": {
"DATE_1": “10-03-2024”
}
}

Minutes
Example 1
Context Variables:
[
{“name": “Appointment DateTime”, "type": "Date”},
]
Query:
Retrieve the minute component from the given appointment datetime.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "arg1",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Appointment DateTime",
"part": null
}
}
],
"functionName": "Minutes"
}
]
},
"dateMap": {}
}

Seconds
Example 1
Context Variables:
[
{“name": “Event Timestamp”, "type": "Date”},
]
Query:
Retrieve the seconds component from the given event timestamp.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "arg1",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Event Timestamp",
"part": null
}
}
],
"functionName": "Seconds"
}
]
},
"dateMap": {}
}

MaxHoursBetweenDates
Example 1
Context Variables:
[
{"name": "Task Start DateTime", "type": "Date"},
{"name": "Task End DateTime", "type": "Date”},
{"name": "Task Testing DateTime", "type": "Date”},
]
Query:
Calculate the number of hours between the earliest and latest dates
for a given task.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Task Start DateTime",
"part": null
}
},
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Task End DateTime",
"part": null
}
},
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Task Testing DateTime",
"part": null
}
}
],
"functionName": "MaxHoursBetweenDates"
}
]
},
"dateMap": {
}
}

Example 2
Context Variables:
[
{"name": "Task Start DateTime", "type": "Date"},
{"name": "Task End DateTime", "type": "Date”},
{"name": "Task Testing DateTime", "type": "Date”},
]
Query:
Calculate the number of hours between 12-03-2024 and 12-09-2024
(mm-dd-yyyy) .
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date",
"children": null,
"value": "DATE_1" // Placeholder for the first epoch value
},
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date",
"children": null,
"value": "DATE_2" // Placeholder for the second epoch
value
}
],
"functionName": "MaxHoursBetweenDates"
}
]
},
"dateMap": {
"DATE_1": “03-12-2024”,
"DATE_2": “09-12-2024”
}
}

Example 3
Context Variables:
[
{"name": "Task Start DateTime", "type": "Date"},
{"name": "Task End DateTime", "type": "Date”},
{"name": "Task Testing DateTime", "type": "Date”},
]
Query:
Calculate the number of hours between 12-03-2024 (mm-dd-yyyy).
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date",
"children": null,
"value": "DATE_1" // Placeholder for the epoch value
}
],
"functionName": "MaxHoursBetweenDates"
}
]
},
"dateMap": {
"DATE_1": “03-12-2024”
}
}

MaxMinutesBetweenDates
Example 1
Context Variables:
[
{"name": "Task Start DateTime", "type": "Date"},
{"name": "Task End DateTime", "type": "Date”},
{"name": "Task Testing DateTime", "type": "Date”},
{"name": “Event Start DateTime", "type": "Date"},
{"name": “Event End DateTime", "type": "Date”}
]
Query:
Calculate the number of minutes between the earliest and latest dates
for a given event.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Event Start DateTime",
"part": null
}
},
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Event End DateTime",
"part": null
}
}
],
"functionName": "MaxMinutesBetweenDates"
}
]
},
"dateMap": {}
}
Example 2
Context Variables:
[
{"name": "Task Start Date", "type": "Date"},
{"name": "Task End Date", "type": "Date”},
{"name": "Task Testing Date", "type": "Date”},
{"name": “Event Start Date", "type": "Date"},
{"name": “Event End Date", "type": "Date”}
]
Query:
Calculate the number of minutes between the Task Start date and
Project Deadline
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Task Start Date",
"part": null
}
}
],
"functionName": "MaxMinutesBetweenDates"
}
]
},
"dateMap": {}
}

QuarterOfYear
Example 1
Context Variables:
[
{“name": “Sales Date”, "type": "Date”},
]
Query:
Determine the quarter of the year in which the given Sales Date falls,
considering April as the start month for the quarter.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Sales Date",
"part": null
}
},
{
"type": "Constant",
"valueType": "PickOne",
"argLabel": "start month",
"children": null,
"value": 4
}
],
"functionName": "QuarterOfYear"
}
]
},
"dateMap": {
}
}

Example 2
Context Variables:
[
{“name": “Sales Date”, "type": "Date”},
]
Query:
Determine the quarter of the year
Answer:{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date",
"children": null,
"value": null
},
{
"type": "Constant",
"valueType": "PickOne",
"argLabel": "start month",
"children": null,
"value": null
}
],
"functionName": "QuarterOfYear"
}
]
},
"dateMap": {}
}

Example 3
Context Variables:
[
{“name": “Sales Date”, "type": "Date”},
{“name": “Inauguration Date”, "type": "Date”},
]
Query:
Determine the quarter of the year with the Inauguration Date.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Inauguration Date",
"part": null
}
},
{
"type": "Constant",
"valueType": "PickOne",
"argLabel": "start month",
"children": null,
"value": null
}
],
"functionName": "QuarterOfYear"
}
]
},
"dateMap": {}
}

CompareDates
Example 1
Context Variables:
[
{"name": "Date1", "type": "Date"},
{"name": "Date2", "type": "Date"},
]
Query:
Compare the dates Date1 and Date2 to check if they fall in the same
week (starting on Monday):
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date1",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Date1",
"part": null
}
},
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date2",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Date2",
"part": null
}
},
{
"type": "Constant",
"valueType": "PickOne",
"argLabel": "comparison criteria",
"children": null,
"value": "Week"
},
{
"type": "Constant",
"valueType": "PickOne",
"argLabel": "start day of week",
"children": null,
"value": "Monday"
}
],
"functionName": "CompareDates"
}
]
},
"dateMap": {}
}

Example 2
Context Variables:
[
{"name": "Date1", "type": "Date"},
{"name": "Date2", "type": "Date"},
]
Query:
Compare the dates Date1 and 12th Jan 2024 to check if they are the
same day (starting on Monday):
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date1",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Date1",
"part": null
}
},
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date2",
"children": null,
"value": "DATE_1"
},
{
"type": "Constant",
"valueType": "PickOne",
"argLabel": "comparison criteria",
"children": null,
"value": "Day"
},
{
"type": "Constant",
"valueType": "PickOne",
"argLabel": "start day of week",
"children": null,
"value": "Monday"
}
],
"functionName": "CompareDates"
}
]
},
"dateMap": {
"DATE_1": "12-01-2024"
}
}

Example 3
Context Variables:
[
{"name": "Date1", "type": "Date"},
{"name": "Date2", "type": "Date"},
]
Query:
Compare the dates Date2 and Promotion Date
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Boolean",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date1",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Date2",
"part": null
}
},
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date2",
"children": null,
"value": null
},
{
"type": "Constant",
"valueType": "PickOne",
"argLabel": "comparison criteria",
"children": null,
"value": null
},
{
"type": "Constant",
"valueType": "PickOne",
"argLabel": "start day of week",
"children": null,
"value": null
}
],
"functionName": "CompareDates"
}
]
},
"dateMap": {}
}

CountWorkDays
Example 1
Context Variables:
[
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date"}
]
Query:
Calculate the number of workdays between the specified project start
and end dates, excluding the non-working days(Saturday and Sunday).
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "start date",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Project Start Date",
"part": null
}
},
{
"type": "Variable",
"valueType": "Long",
"argLabel": "end date",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Project End Date",
"part": null
}
},
{
"type": "Constant",
"valueType": "Checkboxes",
"argLabel": "non working days",
"children": null,
"value": [
"Saturday",
"Sunday"
]
}
],
"functionName": "CountWorkDays"
}
]
},
"dateMap": {}
}

Example 2
Context Variables:
[
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date”},
{“name": “IPO Start Date”, "type": "Date”},
{"name": “IPO End Date”, "type": "Date"}
]
Query:
Calculate the number of workdays between the specified IPO start and
IPO end dates.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "start date",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "IPO Start Date",
"part": null
}
},
{
"type": "Variable",
"valueType": "Long",
"argLabel": "end date",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "IPO End Date",
"part": null
}
},
{
"type": "Constant",
"valueType": "Checkboxes",
"argLabel": "non working days",
"children": null,
"value": null
}
],
"functionName": "CountWorkDays"
}
]
},
"dateMap": {}
}

DateToEpoch
Example 1
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date”},
{"name": “Holiday List, "type": "Date Range”},
{"name": “Holiday List, "type": "Date-Time Range”},
{“name": “Sales Date”, "type": "Date”},
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date"}
]
Query:
Convert the Sales Date to Epoch Time
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Long",
"argLabel": "date",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Long",
"name": "Sales Date",
"part": null
}
}
],
"functionName": "DateToEpoch"
}
]
},
"dateMap": {
}
}

Example 2
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date”},
{"name": “Holiday List, "type": "Date Range”},
{"name": “Holiday List, "type": "Date-Time Range”},
{“name": “Sales Date”, "type": "Date”},
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date"}
]
Query:
Convert the 14th May 2024 9:00 AM to Epoch Time
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date",
"children": null,
"value": "DATE_1"
}
],
"functionName": "DateToEpoch"
}
]
},
"dateMap": {
"DATE_1": "14-05-2024 9:00 AM“
}
}

Example 3
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date”},
{"name": “Holiday List, "type": "Date Range”},
{"name": “Holiday List, "type": "Date-Time Range”},
{“name": “Sales Date”, "type": "Date”},
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date"}
]
Query:
Convert the IPO Date to Epoch Time
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Date",
"argLabel": "date",
"children": null,
"value": null
}
],
"functionName": "DateToEpoch"
}
]
},
"dateMap": {}
}

EpochToDate
Examples 1
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date”},
{"name": “Holiday List, "type": "Date Range”},
{"name": “Holiday List, "type": "Date-Time Range”},
{“name": “Sales Date”, "type": "Date”},
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date"},
{"name": “Epoch Time”, "type": “Number”}
]
Query:
Convert the given epoch time in milliseconds to a human-readable
date.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Long",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Double",
"argLabel": "epoch in milliseconds",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Double",
"name": "Epoch Time",
"part": null
}
}
],
"functionName": "EpochToDate"
}
]
},
"dateMap": {
}
}

Examples 2
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date”},
{"name": “Holiday List, "type": "Date Range”},
{"name": “Holiday List, "type": "Date-Time Range”},
{“name": “Sales Date”, "type": "Date”},
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date"},
{"name": “Epoch Time”, "type": “Number”}
]
Query:
Convert the epoch time 1728048366306 to date.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Long",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Number",
"argLabel": "epoch in milliseconds",
"children": null,
"value": 1728048366306
}
],
"functionName": "EpochToDate"
}
]
},
"dateMap": {}
}

CreateDate
Example 1
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date”},
{"name": “Holiday List, "type": "Date Range”},
{"name": “Holiday List, "type": "Date-Time Range”},
{“name": “Sales Date”, "type": "Date”},
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date"},
{"name": “Epoch Time”, "type": “Number”}
]
Query:
Create a date with the following values - 19 , 5 , 1998 in the format
dd/mm/yyyy
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Long",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Number",
"argLabel": "day",
"children": null,
"value": 19
},
{
"type": "Constant",
"valueType": "Number",
"argLabel": "month",
"children": null,
"value": 5
},
{
"type": "Constant",
"valueType": "Number",
"argLabel": "year",
"children": null,
"value": 1998
}
],
"functionName": "CreateDate"
}
]
},
"dateMap": {}
}

Example 2
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date”},
{"name": “Holiday List, "type": "Date Range”},
{"name": “Holiday List, "type": "Date-Time Range”},
{“name": “Sales Date”, "type": "Date”},
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date"},
{"name": “Epoch Time”, "type": “Number”}
]
Query:
Create a date
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Long",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "Number",
"argLabel": "day",
"children": null,
"value": null
},
{
"type": "Constant",
"valueType": "Number",
"argLabel": "month",
"children": null,
"value": null
},
{
"type": "Constant",
"valueType": "Number",
"argLabel": "year",
"children": null,
"value": null
}
],
"functionName": "CreateDate"
}
]
},
"dateMap": {}
}

Example 3
Context Variables:
[
{“name": “Day”, "type": "Date”},
{"name": “Month, "type": "Date Range”},
{"name": “Holiday List, "type": "Date-Time Range”},
{“name": “Sales Date”, "type": "Date”},
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date"},
{"name": “Epoch Time”, "type": “Number”}
]
Query:
Create a date using Day , Month and 1998 as the year
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Long",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Double",
"argLabel": "day",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Double",
"name": "Day",
"part": null
}
},
{
"type": "Variable",
"valueType": "Double",
"argLabel": "month",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Double",
"name": "Month",
"part": null
}
},
{
"type": "Constant",
"valueType": "Number",
"argLabel": "year",
"children": null,
"value": 1998
}
],
"functionName": "CreateDate"
}
]
},
"dateMap": {}
}

TimezoneOffset
Example 1
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date”},
{"name": “Holiday List, "type": "Date Range”},
{"name": “Holiday List, "type": "Date-Time Range”},
{“name": “Sales Date”, "type": "Date”},
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date"},
{"name": “Epoch Time”, "type": “Number”}
]
Query:
Retrieve the offset in minutes for America/Denver timezone.
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "PickOne",
"argLabel": "timezone",
"children": null,
"value": "America/Denver"
}
],
"functionName": "TimezoneOffset"
}
]
},
"dateMap": {}
}

Example 2
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date”},
{"name": “Holiday List, "type": "Date Range”},
{"name": “Holiday List, "type": "Date-Time Range”},
{“name": “Sales Date”, "type": "Date”},
{“name": “Project Start Date”, "type": "Date”},
{"name": “Project End Date”, "type": "Date"},
{"name": “Epoch Time”, "type": “Number”}
]
Query:
Find the timezone offset of
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Constant",
"valueType": "PickOne",
"argLabel": "timezone",
"children": null,
"value": null
}
],
"functionName": "TimezoneOffset"
}
]
},
"dateMap": {}
}

Example 2
Context Variables:
[
{“name": “Meeting Slot”, "type": "Date”},
{"name": “Holiday List, "type": "Date Range”},
{"name": “Holiday List, "type": "Date-Time Range”},
{“name": “Timezone”, "type": “Text”},

]
Query:
Find the timezone offset of Timezone
Answer:
{
"expression": {
"type": "Expression",
"valueType": "?",
"argLabel": "arg1",
"children": [
{
"type": "Function",
"valueType": "Double",
"argLabel": "arg1",
"children": [
{
"type": "Variable",
"valueType": "Text",
"argLabel": "timezone",
"children": null,
"scope": "current",
"part": {
"type": "Simple",
"valueType": "Text",
"name": "Timezone",
"part": null
}
}
],
"functionName": "TimezoneOffset"
}
]
},
"dateMap": {}
}

You might also like