i2 Tip: An iBase query with variable input
In analyses, it may happen that you want to reuse a query often to search and query your data, but it needs to be slightly different each time. Things like the date or the name of a person or organisation, for instance. It can be time consuming to re-enter the query each time. i2 iBase offers two different options so you don't need to, and you can perform your analyses easier and with fewer actions.
A query requesting input
The first way to create a query with a variable input in iBase is to include an “@” in your query instead of a value. If you do so, when performing the query, iBase will ask you to enter data for the specified field.
It is possible to use an “@” more than once in a single query. In the example below, data is requested for two entities and one link. Please note, if you have used the same entity twice, this may cause confusion. Does person 1 or person 2 belong to that specific surname and date of birth?
Another option is to propose a value in advance. You do this by typing it after the “@”. This can be a value you use a lot, but could also help the user determine what to fill in. You can adjust this suggestion when asked to enter a value.
A query that looks at certain system variables
The second way to create a variable input query is to create a query that looks at certain system variables. There are some system variables available that you can use in iBase. They all start with “@#” followed by the name of the parameter in capital letters. Below you will find the possibilities.
Parameter |
Description |
@#USER |
The username of the person who is logged into iBase |
@#NOWDATE |
The current date |
@#NOWDATE +N/-N |
The current date + or - a number of days |
@#NOWTIME |
The current time |
@#NOWTIME +N/-N |
The current time + or - a number of hours |
In the example below, we have entered the system variable @#NOWDATE-30 for Value 1. This allows you to retrieve which records have changed in the last 30 days. (Change date is of field type “Update date & Time”).
Would you like to know what other possibilities i2 iBase offers you? Then consider one of our training courses or contact us.