Focal Point
[CLOSED]Filters Displaying for Headings Using Parameters

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1327041186

March 07, 2016, 09:54 AM
JulieA
[CLOSED]Filters Displaying for Headings Using Parameters
Filters Displaying for Headings Using Parameters


I created an HTML page consisting of two fexes created in 8.0.09.

The page contains two bar graphs linked by the same two parameters used as filters for users to make selections.

I have searched the forum for an answer, but I must be overlooking the obvious. So I apologize if I missed a post that would solve this problem.

My goal is to get one of the following four possibilities to display correctly in the graph headings based on user choices for the filters. The graphs themselves display correctly.

1. Systemwide

A user doesn’t make a selection for either parameter.
The data displayed in the chart is for all regions and all dealerships.
The heading should indicate Systemwide on the first line. Nothing else should appear in the heading.

2. Region
A user makes a selection in the region parameter but does not make a selection in the dealership parameter.
The displayed is for all dealerships within a particular region.
The heading should indicate the region such as West on the first line. Nothing else should appear in the heading.

3. Region and Dealership
A user makes a selection in both the region and dealership parameters.
The data displayed is for a particular dealership within a particular region.
The heading should indicate the region on the first line and the dealership on the second line.

4. Dealership
A user makes a selection in the dealership column only but does not make a selection in the region parameter.

The data displayed is for a particular dealership in any of the four regions. The dealership name should display on the first line not on the second line nor should it create a blank line.

(FYI. I know I need to add DRPBLNKLINE = HEADING to the code to help with this.)

Below is the snippet of my code related to the headings.

In the fex I have these two –SET lines:

-SET ®ION_HEAD = IF ®ION_NAME EQ '_FOC_NULL' THEN 'Systemwide' ELSE ®ION_NAME;
-SET &DEALERSHIP_HEAD = IF &DEALERSHIP EQ '_FOC_NULL' THEN ' ' ELSE &DEALERSHIP;

I also have these three lines of code related to the headings:
HEADING
"&SECTOR_HEAD”
“&INST_HEAD"

My two parameters within the fex are established like this:

WHERE AUTOMOBILES.AUTOMOBILES.DEALERSHIP EQ '&DEALERSHIP.(FIND AUTOMOBILES.AUTOMOBILES.DEALERSHIP IN AUTOMOBILES).Dealership:.';

WHERE AUTOMOBILES.AUTOMOBILES.REGION EQ ®ION.(,,,).Region:.';

In the HTML page properties, I use _FOC_NULL

The two parameters are chained on the parameters tab so that if West region displays in the parameter, only dealerships in the West region display.

On the parameters portion of the HTML page, I set the region’s displayed default to ignore and typed in the word “Systemwide” for the Systemwide Heading.

On the dealership’s parameter, I set the institution’s displayed default to all and typed in “All Dealerships for Region”

Right now the fex does not operate correctly. If I select just a dealership without selecting a region, “systemwide” shows up in the heading.

This message has been edited. Last edited by: <Emily McAllister>,


WebFocus 8.2.04
WebFocus 8.2.04

March 08, 2016, 07:33 AM
MartinY
Try something like that, the basics always works:
-*CASE 1
-DEFAULT &CNTRY  = _FOC_NULL
-DEFAULT &DEALER = _FOC_NULL
-*-*CASE 2
-*-DEFAULT &CNTRY  = 'ITALY'
-*-DEFAULT &DEALER = _FOC_NULL
-*-*CASE 3
-*-DEFAULT &CNTRY  = 'W GERMANY'
-*-DEFAULT &DEALER = 'BMW'
-*-*CASE 4
-*-DEFAULT &CNTRY  = _FOC_NULL
-*-DEFAULT &DEALER = 'TOYOTA'

-SET &HEAD_LN1 = IF &CNTRY EQ '_FOC_NULL' AND &DEALER EQ '_FOC_NULL' THEN 'Systemwide'
-           ELSE IF &CNTRY NE '_FOC_NULL' AND &DEALER EQ '_FOC_NULL' THEN &CNTRY
-           ELSE IF &CNTRY NE '_FOC_NULL' AND &DEALER NE '_FOC_NULL' THEN &CNTRY
-           ELSE IF &CNTRY EQ '_FOC_NULL' AND &DEALER NE '_FOC_NULL' THEN &DEALER;
-SET &HEAD_LN2 = IF &CNTRY EQ '_FOC_NULL' AND &DEALER EQ '_FOC_NULL' THEN ''
-           ELSE IF &CNTRY NE '_FOC_NULL' AND &DEALER EQ '_FOC_NULL' THEN ''
-           ELSE IF &CNTRY NE '_FOC_NULL' AND &DEALER NE '_FOC_NULL' THEN &DEALER
-           ELSE IF &CNTRY EQ '_FOC_NULL' AND &DEALER NE '_FOC_NULL' THEN '';
-SET &DISP_LN2 = IF &CNTRY EQ '_FOC_NULL' AND &DEALER EQ '_FOC_NULL' THEN '-*'
-           ELSE IF &CNTRY NE '_FOC_NULL' AND &DEALER EQ '_FOC_NULL' THEN '-*'
-           ELSE IF &CNTRY NE '_FOC_NULL' AND &DEALER NE '_FOC_NULL' THEN ''
-           ELSE IF &CNTRY EQ '_FOC_NULL' AND &DEALER NE '_FOC_NULL' THEN '-*';

TABLE FILE CAR
PRINT MODEL
BY COUNTRY
BY CAR
WHERE COUNTRY EQ '&CNTRY';
WHERE CAR     EQ '&DEALER';

HEADING
"&HEAD_LN1"
&DISP_LN2.EVAL "&HEAD_LN2"
END
-RUN



WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007