Let’s suppose you want your end-user only see sales data from customers assigned to him.

Here is the query of the report.

image827.jpg

For now the report shows records for all customers.

image828.jpg

Let’s assign a user variable.

Double click  on the Criteria/Parameter field.

image829.jpg

The Criteria Builder will open.

image830.jpg

Click "User-Variables".

image831.jpg

Assign a name for the user variable to create.

Optionally click "Multiple Values".

Select the user and click "Show Values".

image832.jpg

Select one or multiple values and click "Ok".

image833.jpg

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.

image834.jpg

The user variable will be inserted.

Click "Ok" to close the expression window.

The user variable criteria will be inserted into the query.

image160.gif

Now; let’s open the report again.

image835.jpg

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.

image837.jpg

image838.jpg

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.