Let’s suppose you want your end-user only see sales data from customers assigned to him.
Here is the query of the report.
For now the report shows records for all customers.
Let’s assign a user variable.
Double click on the Criteria/Parameter field.
The Criteria Builder will open.
Assign a name for the user variable to create.
Optionally click "Multiple Values".
Select the user and click "Show Values".
Select one or multiple values and click "Ok".
The variables are inserted.
Repeat the previous step for each user.
Once finished click "Save" and exit the window.
Now; on the Expression window select the user variable and double click it.
The user variable will be inserted.
Click "Ok" to close the expression window.
The user variable criteria will be inserted into the query.
Now; let’s open the report again.
Now the report only shows records for customer assigned to the user who is logged in DBxtra.
You can also enhance the user variable by editing a query.
To do that click the "Query" button.
Now you can edit the variable query; add tables and views by right clicking into the query panel, assign aggregate functions and more.
Note! We showed you user-variables but the same works for user group-variables.
You can maintain user and user group variables from the utilities menu.