Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Condtional Image load

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Condtional Image load
 Login/Join
 
Member
posted
I have 2 fex files each with a single numerical output (one represents a CNT at quarter end last quarter, the other represents a CNT at quarter end 2 quarters ago), I want to calculate the difference between those 2 fex files and where Q1 GT Q2 an image of an up arrow, Q1 EQ Q2 an image of a flat arrow, Q1 LT Q2 an image of a down arrow.

This sample car file should get me an up arrow if done correctly, I just cant figure out where I'm going wrong. I am very new at webfocus (started in June) so I could be going all about this wrong, if there is an easier way, please let me know. (I do need to keep the fex files separate from one another as they are referenced in individually throughout reports.)

File 1:Represents one quarter ago

SET ASNAMES = ON
TABLE FILE CAR
SUM
CNT.CAR.COMP.CAR AS 'QUARTER1'
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE HOLD AS Q1HOLD
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END
-RUN
-READFILE Q1HOLD
-RUN

File 2:Represents two quarter ago

SET ASNAMES = ON
TABLE FILE CAR
SUM
CNT.CAR.COMP.CAR AS 'QUARTER2'
WHERE CAR.COMP.CAR EQ 'BMW';
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE HOLD AS Q2HOLD
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END
-RUN
-READFILE Q2HOLD
-RUN

File 3: determine difference and upload corresponding jpg image

-IF &QUARTER1 GT &QUARTER2 THEN GOTO UPARROW
- ELSE IF &QUARTER1 EQ &QUARTER2 THEN GOTO FLATARROW
- ELSE IF &QUARTER1 LT &QUARTER2 THEN GOTO DOWNARROW
- ELSE GOTO ENDARROW;
-DOWNARROW
TABLE FILE CAR
SUM
FST.CAR.COMP.CAR NOPRINT AS ''
ON TABLE SUBHEAD
""
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,

$
TYPE=TABHEADING,
IMAGE=IBFS:/WFC/Repository/eGRC/Standard_Reports/SCORECARD/down.jpg,
POSITION=(+0.000000 +0.000000),
$
ENDSTYLE
END
-GOTO ENDARROW;
-FLATARROW
TABLE FILE CAR
SUM
FST.CAR.COMP.CAR NOPRINT AS ''
ON TABLE SUBHEAD
""
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,

$
TYPE=TABHEADING,
IMAGE=IBFS:/WFC/Repository/eGRC/Standard_Reports/SCORECARD/flat.jpg,
POSITION=(+0.000000 +0.000000),
$
ENDSTYLE
END
-GOTO ENDARROW;
-UPARROW
TABLE FILE CAR
SUM
FST.CAR.COMP.CAR NOPRINT AS ''
ON TABLE SUBHEAD
""
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,

$
TYPE=TABHEADING,
IMAGE=IBFS:/WFC/Repository/eGRC/Standard_Reports/SCORECARD/up.jpg,
POSITION=(+0.000000 +0.000000),
$
ENDSTYLE
END
-ENDARROW



WF: Webfocus 8.0.0.7
OS: Windows
Data: SQL
Output: Multiple

This message has been edited. Last edited by: <Kathryn Henning>,
 
Posts: 5 | Registered: May 27, 2014Report This Post
Virtuoso
posted Hide Post
I am not sure where you are going wrong, as logically there should not be an issue if everything is where it is meant to be. There is a simpler approach, but first can you tell us what you are getting, and also run with:
-SET &ECHO=ALL;

at the start and view source to see what is happening.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Virtuoso
posted Hide Post
I know that this won't solve your issue, but you may simplify a bit your code using this instead.

-SET &IMG = IF &QUARTER1 GT &QUARTER2 THEN 'IBFS:/WFC/Repository/eGRC/Standard_Reports/SCORECARD/up.jpg'
-      ELSE IF &QUARTER1 EQ &QUARTER2 THEN 'IBFS:/WFC/Repository/eGRC/Standard_Reports/SCORECARD/flat.jpg'
-      ELSE 'IBFS:/WFC/Repository/eGRC/Standard_Reports/SCORECARD/down.jpg';

TABLE FILE CAR
SUM
 FST.CAR.COMP.CAR NOPRINT AS ''
ON TABLE SUBHEAD
""
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
 INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
TYPE=TABHEADING,
 IMAGE=&IMG.EVAL,
 POSITION=(+0.000000 +0.000000),
$
ENDSTYLE
END


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
 
Posts: 2410 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Master
posted Hide Post
This seems unnecessarily complex. I would use MATCH FILE processing to get the two totals into a single HOLD. You also have a ton of style settings that are just cluttering up your HOLD files.

SET ASNAMES=ON

MATCH FILE CAR
SUM
CNT.CAR.COMP.CAR AS 'QUARTER1'
BY COUNTRY
RUN
FILE CAR
SUM
CNT.CAR.COMP.CAR AS 'QUARTER2'
BY COUNTRY
WHERE CAR.COMP.CAR EQ 'BMW';
AFTER MATCH HOLD AS Q1Q2HOLD
END


Use this resulting HOLD file for the fancy arrows .. Smiler


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Report This Post
Master
posted Hide Post
How's this...

DEFINE FILE CAR
	Q1/A16 = CAR;
	Q2/A16 MISSING ON = IF CAR EQ 'BMW' THEN CAR ELSE MISSING; 
END

TABLE FILE CAR
SUM 
     CNT.Q1
     CNT.Q2
     COMPUTE ARROW/A5 = IF CNT.Q1 GE CNT.Q2 THEN 'ä' ELSE 'ã'; AS 'updown'
ON TABLE SET PAGE-NUM NOLEAD 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET STYLE *
$
TYPE=DATA,
     COLUMN=N3,
     FONT='WINGDINGS',
$
ENDSTYLE
END


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Member
posted Hide Post
George - Match file seems like that could help me get where I need to go. I will give that a shot.

Dave - this would work if some how my defines could reference the output from 2 fex files. My filters are not as basic as I have created in the sample car file ( I only filtered on bmw to get different numbers, thus getting an up arrow), so its a must to reference those other fex files and then calculate the difference.

Martin Y - That code will help me simplify things, still learning, so any advice helps.

Alan - In simple terms, I want to compare the output from 2 fex files and based on the difference between those two files an arrow is represented, my only output would be an arrow. I may not have explained myself very well the first time, I don't know all the lingo quite yet, but I'm trying Smiler

I will test some options and reply back later this week, wife just had a baby 2 days ago, and sleep seems to come few and far between, so sorry for the late response.


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 5 | Registered: May 27, 2014Report This Post
Virtuoso
posted Hide Post
So Steven, having something such as below should do almost what you're looking for.
If I understood properly your request is to "read" two parameters to then assign proper image to display.

SET ASNAMES = ON
-*File 1:Represents one quarter ago
TABLE FILE CAR
SUM
 CNT.CAR AS 'QUARTER1'
ON TABLE HOLD AS Q1HOLD FORMAT BINARY
END
-RUN

-READFILE Q1HOLD
-RUN
-TYPE &QUARTER1

-*File 2:Represents two quarter ago
TABLE FILE CAR
SUM
 CNT.CAR.COMP.CAR AS 'QUARTER2'
WHERE CAR.COMP.CAR EQ 'BMW';
ON TABLE HOLD AS Q2HOLD FORMAT BINARY
END
-RUN

-READFILE Q2HOLD
-RUN
-TYPE &QUARTER2

-* DISPLAY PROPER IMAGE
-SET &IMG = IF &QUARTER1 GT &QUARTER2 THEN 'IBFS:/WFC/Repository/eGRC/Standard_Reports/SCORECARD/up.jpg'
-      ELSE IF &QUARTER1 EQ &QUARTER2 THEN 'IBFS:/WFC/Repository/eGRC/Standard_Reports/SCORECARD/flat.jpg'
-      ELSE 'IBFS:/WFC/Repository/eGRC/Standard_Reports/SCORECARD/down.jpg';

TABLE FILE CAR
BY CAR NOPRINT
WHERE READLIMIT   EQ 1;
WHERE RECORDLIMIT EQ 1;
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
 INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
TYPE=TABHEADING,
 IMAGE=&IMG.EVAL,
 POSITION=(+0.000000 +0.000000),
$
ENDSTYLE
END
-RUN


It may have different way to do it, but this is one.


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
 
Posts: 2410 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Member
posted Hide Post
Here is a successful conditional image load using 2 fex files with numerical outputs

FEX FILE 1:

-DEFAULTH &NUMA = 'X'
-DEFAULTH &NUMB = 'T'
DEFINE FILE CAR
NUMA/D6 = 240;
NUMB/D6 = 180;
END
SET HOLDLIST = PRINTONLY
TABLE FILE CAR
SUM MAX.NUMA BY COUNTRY NOPRINT
WHERE READLIMIT EQ 1 WHERE RECORDLIMIT EQ 1
ON TABLE HOLD AS VALA
END
-RUN
-READFILE VALA
TABLE FILE CAR
SUM
MAX.NUMA AS ''
BY COUNTRY NOPRINT
WHERE RECORDLIMIT EQ 1
WHERE READLIMIT EQ 1
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
END



FEX FILE 2:

-DEFAULTH &NUMA = 'X'
-DEFAULTH &NUMB = 'T'
DEFINE FILE CAR
NUMA/D6 = 240;
NUMB/D6 = 180;
END
SET HOLDLIST = PRINTONLY
TABLE FILE CAR
SUM MAX.NUMB BY COUNTRY NOPRINT
WHERE READLIMIT EQ 1 WHERE RECORDLIMIT EQ 1
ON TABLE HOLD AS VALB
END
-RUN
-READFILE VALB
TABLE FILE CAR
SUM
MAX.NUMB AS ''
BY COUNTRY NOPRINT
WHERE RECORDLIMIT EQ 1
WHERE READLIMIT EQ 1
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
END


FEX FILE 3:


-SET &NUMC ='&NUMA.EVAL';
-SET &NUMD ='&NUMB.EVAL';

-IF &NUMC LT &NUMD THEN GOTO DOWNARROW ELSE IF &NUMC EQ &NUMD THEN GOTO FLATARROW ELSE IF &NUMC GT &NUMD THEN GOTO UPARROW;

-DOWNARROW

-INCLUDE IBFS:/WFC/Repository/eGRC/Standard_Reports/SCORECARD/passvar_DOWNARROW.fex
-GOTO ENDARROW;
-FLATARROW

-INCLUDE IBFS:/WFC/Repository/eGRC/Standard_Reports/SCORECARD/passvar_FLATARROW.fex
-GOTO ENDARROW;

-UPARROW

-INCLUDE IBFS:/WFC/Repository/eGRC/Standard_Reports/SCORECARD/passvar_UPARROW.fex
-ENDARROW

END


AND THERE ARE 3 FEX FILES THAT WILL BE USED AS THE REFERENCE IMAAGES AND CALCULATE DIFFERENCE, HAD A HARD TIME DIRECTLY REFERENCING IMAGES IN DUE TO THE OUTPUT BEING A PDF, SO I NEEDED TO PUT MY IMAGES IN DATA SERVERS, HERES AN EXAMPLE OF ONE OF THE ARROW FEX FILES


-SET &NUMC ='&NUMA.EVAL';
-SET &NUMD ='&NUMB.EVAL';

DEFINE FILE CAR
DIFFER/D10=&NUMC - &NUMD;
ARROWDEFINED/A200=
IF DIFFER GT 0 THEN 'IBFS:/WFC/Repository/eGRC/Standard_Reports/SCORECARD/up.jpg'
ELSE IF DIFFER EQ 0 THEN 'IBFS:/WFC/Repository/eGRC/Standard_Reports/SCORECARD/flat.jpg'
ELSE 'IBFS:/WFC/Repository/eGRC/Standard_Reports/SCORECARD/down.jpg';
END
TABLE FILE CAR
PRINT
COUNTRY NOPRINT
ON TABLE SUBHEAD
" "
" "
" "
WHERE RECORDLIMIT EQ 1
WHERE READLIMIT EQ 1
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$

TYPE=TABHEADING,
IMAGE=IBFS:/WFC/Repository/eGRC/Standard_Reports/SCORECARD/down.jpg,
POSITION=(+0.000000 +0.000000),
$

ENDSTYLE
END
 
Posts: 5 | Registered: May 27, 2014Report This Post
Member
posted Hide Post
ISSUE SOLVED - THANKS ALL FOR YOUR INPUT. I FOUND THESE FORUMS TO BE A LOT OF HELP.
 
Posts: 5 | Registered: May 27, 2014Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Condtional Image load

Copyright © 1996-2020 Information Builders