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     test for specific user input parameter [SOLVED]

Read-Only Read-Only Topic
Go
Search
Notify
Tools
test for specific user input parameter [SOLVED]
 Login/Join
 
Master
posted
I have a user supplied parameter which could be any one of 6 values (ie. agegrp, county, race, etc.)

I have a define to assign flag ('1') for user selection of AGEGRP and ('0') for any of the other 5 values.

Here is my code:

quote:


-SET &RPTTYPE = 'RACE';

-SET &XFNT = &RPTTYPE | '_' | 10 | '_' | A;
-TYPE XFNT = &XFNT

DEFINE FILE RACE_10_A
QFLAG/A1 = IF RACE EQ 'AGEGRP' THEN '1' ELSE '0';
END

TABLE FILE RACE_10_A
SUM
QFLAG
END
-RUN



The problem I am having is that I cannot get a
onsistent answer (1 or 0) when I run it.

Is there someting I am missing here?

Thanks! Red Face

This message has been edited. Last edited by: Tomsweb,


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Expert
posted Hide Post
What are you expecting to have returned in the report? You will get one value for QFLAG, the last one read.
TABLE FILE RACE_10_A
SUM
QFLAG
END
-RUN


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
<JG>
posted
quote:
TABLE FILE RACE_10_A
SUM
QFLAG


Francis hits it on the head.

SUM means SUM,.

In WebFOCUS for ALPHA values that means the last value ,
for numerics it means the sum of the values.

Ask the right question and you get the right answer.
 
Report This Post
Master
posted Hide Post
Hi Francis

No, I am actually trying to create other define logic based on whether user selected
to work with race table or the agegrp table. The table request is there to see if the
define field matched the user input parameter.

Thanks,


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Master
posted Hide Post
JG?

Again, the user selects from among 6 values for the table to report against.

I am trying to build some logic to have the data in the agegrp table handled a little differently than data in the other tables.

So, the question is:

-SET &RPTTYPE = 'AGEGRP';
-SET &XFNT = &RPTTYPE | '_' | 10 | '_' | A;

DEFINE FILE &XFNT
QFLAG/A1 = IF &RPTTYPE EQ 'AGEGRP' THEN '1' ELSE '0';
END

When I look at the QFLAG field above, I'm expecting to get a value of '1' because in
this case, the value of &RPTTYPE does EQ 'AGEGRP'.

But I am getting '0' for my answer. What is wrong that I am getting a '0', when I think
I should be getting a '1'?

Thanks!


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Expert
posted Hide Post
Makesure you put quotes around the amper variable, otherwise it will think it is a field.
DEFINE FILE &XFNT
QFLAG/A1 = IF '&RPTTYPE' EQ 'AGEGRP' THEN '1' ELSE '0'; 
END


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Master
posted Hide Post
Thanks Waz,

Here is the error I get if the user selection does not match AGEGRP:

quote:

-SET &RFMT = 'HTML';
-SET &RPTTYPE = 'RACE';

-SET &XFNT = RACE | '_' | 10 | '_' | A;

DEFINE FILE RACE_10_A
QFLAG/A1 WITH AGEGRP = IF 'RACE' EQ 'AGEGRP' THEN '1' ELSE '0';
END

TABLE FILE RACE_10_A
PRINT
QFLAG
END
-RUN


0 ERROR AT OR NEAR LINE 12 IN PROCEDURE agegrp_break
(FOC003) THE FIELDNAME IS NOT RECOGNIZED: AGEGRP

0 ERROR AT OR NEAR LINE 43 IN PROCEDURE agegrp_break
(FOC003) THE FIELDNAME IS NOT RECOGNIZED: QFLAG

BYPASSING TO END OF COMMAND

(FOC009) INCOMPLETE REQUEST STATEMENT
-EXIT
[/QUOTE]


Here is what I get if the user selection matches AGEGRP:

quote:

PAGE 1

QFLAG
1
1
1
1
1
1
1
1
1
1
1


I have written code to handle this sort of thing before, but today I am in qicksand !
Roll Eyes
Thanks,


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Expert
posted Hide Post
The issue with with WITH.

QFLAG/A1 WITH AGEGRP = IF 'RACE'


Change your code to use &RPTTYPE, or another field that exists in each table.

QFLAG/A1 WITH &RPTTYPE = IF '&RPTTYPE' EQ 'AGEGRP' THEN '1' ELSE '0'; 


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Master
posted Hide Post
Thanks Waz. It works.


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Expert
posted Hide Post
Try This:
-SET &RPTTYPE = 'RACE';

-SET &TABLE_NAME = &RPTTYPE || '_10_A' ;
-TYPE TABLE_NAME = &TABLE_NAME
DEFINE FILE &TABLE_NAME.EVAL
TOTAL_FLAG/I1 = IF '&RPTTYPE.EVAL' EQ 'TOTAL' THEN 1 ELSE 0;
END
TABLE FILE &TABLE_NAME.EVAL
PRINT JUL09  JUN10
BY TOTAL_FLAG NOPRINT
BY &RPTTYPE
END
-* STYLE SHEET
-* TYPE=DATA, BACKCOLOR=RED WHEN &RPTTYPE EQ 'TOTAL',%
-* MORE STYLES AS IN YESTERDAYS CODE
-* ENDSTYLE
-RUN
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report 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     test for specific user input parameter [SOLVED]

Copyright © 1996-2020 Information Builders