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     [CLOSED] Is it possible to dynamically assign an AS title to a field?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Is it possible to dynamically assign an AS title to a field?
 Login/Join
 
Member
posted
Hello,
I am currently trying to design a report in InfoAssist that will dynamically assign a title based on the result of an IF statement.

Example:

DEFINE FILE EXAMPLEFILE
define/A10=IF ClusterX.TableX.FieldX EQ 'A' THEN ClusterX.TableY.FieldY ELSE ClusterX.TableX.FieldX;
END
.
.
.
TABLE FILE EXAMPLEFILE
BY define AS (IF FieldY was select then the title of field "Y" else if FieldX was selected then the tile of field "X")
END


Another idea that I had would be to display both fields and hide one of them based on the result of the if statement

Example:

DEFINE FILE EXAMPLEFILE
define/A10=IF ClusterX.TableX.FieldX EQ 'A' THEN ClusterX.TableY.FieldY ELSE ClusterX.TableX.FieldX;
END
.
.
.
TABLE FILE EXAMPLEFILE
BY ClusterX.TableX.FieldX AS "X" (IF FieldY was select then add NOPRINT else if FieldX was selected then display this field)
BY ClusterX.TableY.FieldY AS "Y" (IF FieldX was select then add NOPRINT else if FieldY was selected then display this field)

END

I'm not having any luck with getting either of these to work. I'm not even sure if either of these are possible or if someone has another possible solution that would solve my problem but I would appreciate any advice on how to possibly do this!

The current version that I am running on is 8205 gen number 78.

Thanks,
Alex

This message has been edited. Last edited by: FP Mod Chuck,
 
Posts: 10 | Registered: June 19, 2018Report This Post
Virtuoso
posted Hide Post
AFAIK it's not possible.
You can use a variable such as :
BY ABC AS '&ABCTTL'

But the column title will remain the same for the whole column

One thing that can be done which is "sort of" dynamic, is the following
SET ASNAMES = ON
-SET &CNTRY = 'ENGLAND';
DEFINE FILE CAR
RG_TITLE /A10 = DECODE COUNTRY ('ENGLAND' 'G.-B.' 'JAPAN' 'Asia' ELSE 'Europe');
END
TABLE FILE CAR
BY RG_TITLE
WHERE COUNTRY EQ '&CNTRY';
ON TABLE HOLD AS REGTTL
END
-RUN
-READFILE REGTTL

TABLE FILE CAR
SUM SEATS
BY COUNTRY AS '&RG_TITLE'
BY CAR
WHERE COUNTRY EQ '&CNTRY';
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
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Member
posted Hide Post
I'll give that a try Martin.
Thank you for the information and the suggestion!
 
Posts: 10 | Registered: June 19, 2018Report This Post
Master
posted Hide Post
Not sure if this is exactly what you are looking for, but you can put in a parameter for a a field and prompt for a selection of the field that you want in the report.
  
TABLE FILE car
SUM &MEASURE.( <SALES,SALES AS 'Sales'>,<RETAIL COST,RETAIL_COST AS 'Retail,Cost'>,<DEALER COST,DEALER_COST AS 'Dealer,Cost'>).Select Metric.
BY &DIMENSION.( <COUNTRY,COUNTRY AS 'Country'>,<CAR,CAR AS 'Car'>,<MODEL,MODEL AS 'Model'>).Select Dimension.
ON TABLE SET PAGE-NUM OFF 
ON TABLE SET STYLE *
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/flat.sty,$
ENDSTYLE
END

-RUN


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Report 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     [CLOSED] Is it possible to dynamically assign an AS title to a field?

Copyright © 1996-2020 Information Builders