Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
anuradhaa
Partner - Creator II
Partner - Creator II

condition based data ristriction

Hi,

I have two tables as

sales and agents

In sales and agents has common field agent id

in agents table i have a column called country.

I need to display data in my reports based on country='USA'

Can i do it in front end ( I know we can use set analysis, but then i have to do that in each and every report)

1 Solution

Accepted Solutions
alexandros17
Partner - Champion III
Partner - Champion III

Go in Settings -> Document Properties - >triggers

Select "On Open" Menu Item then press "Edit Action"

press "Add", select "Select in field" and write:

In the upper box Country,  in the lower box USA all without apex ...

let me know

View solution in original post

10 Replies
sunny_talwar

You can add a filter (list box) for country field and make a selection on 'USA' and everything in your application (except for places you have restricted it using set analysis) should display you data for 'USA' only.

alexandros17
Partner - Champion III
Partner - Champion III

You can filter all the data in the script with a where condition (country='USA'), otherwise you can set the country (with a trigger) at the opening of the document. Last option is set analysis

Let me know

anuradhaa
Partner - Creator II
Partner - Creator II
Author

can i set default selection sin list boxes.

anuradhaa
Partner - Creator II
Partner - Creator II
Author

filtering data can't be done because country feild is not available in sales table. can you please explain how to add trigger

sunny_talwar

By default do you mean when you open the application? or do you mean when you press clear?

Both of the options are possible

1)You can set on open trigger

2) You can set the clear state to have USA selected all the time.

sunny_talwar

Even though they come from different tables, you can filter country out if you want

Sales:

LOAD sales,

          agent id

FROM table1;

Agent:

Right Keep (Sales)

LOAD agent id,

          agent name,

          country

FROM table2

Where country = 'USA';

alexandros17
Partner - Champion III
Partner - Champion III

Go in Settings -> Document Properties - >triggers

Select "On Open" Menu Item then press "Edit Action"

press "Add", select "Select in field" and write:

In the upper box Country,  in the lower box USA all without apex ...

let me know

anuradhaa
Partner - Creator II
Partner - Creator II
Author

Thanks all for your contribution

anuradhaa
Partner - Creator II
Partner - Creator II
Author

Hi Your answer also correct. Thank You