magnaview Site Admin
Joined: 06 Sep 2007 Posts: 97
|
Posted: Mon Dec 10, 2007 4:44 pm Post subject: FAQ ID 1018: How do I create a filter on the filter panel which sets the value of an expression for use in a visibility filter? |
|
|
Question: How do I create a filter on the filter panel which sets the value of an expression for use in a visibility filter?
Download project file: FAQ ID 1018
Download data-file: Phone Data
Answer: In the sample project for this FAQ, the user has the possibility to select a month. This month is then used in the visibility expression of this view.
Create two attribute maps. One which holds the months which can be chosen, and one which holds the month that is selected. Next a filter needs to be created. Finally a visibility expression is needed to filter the selected tiles.
A. First, an expression is needed to record the month that is selected;
- Select the attribute ‘Datum_month’;
- Go to the Attributes screen (Tools > Attributes or CTRL + SHIFT + A);
- Click More >> and choose ‘Create Expression of...’ from the menu;
- Under Name fill out Month_selected;
- Under 'Expression' fill in '1', with quotes.
You have now created the attribute, Month_selected, which will record the month that will be picked by the user.
B. Next, a map attribute is needed from which the user will be able to select a specific month.
- Select the attribute ‘Datum_month’;
- Again click "More >" ;
- Choose 'Create map of';
- Select Category map.
You have now created a map, Datum_month_Map, which contains the months.
C. Create the filter which allows the user to set the value of Month_selected.
- Go to the filters screen (Tools > Filters or CTRL + SHFT + F);
- add a new Combobox filter;
- Enter a display name and a filter name you want to use;
- As value for Properties>Attribute, choose Datum_month_Map from the pull-down menu;
- Uncheck Updates>Visible Tiles;
- Check Updates>Attribute;
- For Updates>Attribute, choose the expression created above, that is, Month_selected.
You have created the filter. |
|