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]Need help in coding....

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]Need help in coding....
 Login/Join
 
Gold member
posted
Hello,
I need help in certain task and I am new in developement.
By Default my report shows ALL coverage type A, B, C, D ...(covergarage type)
my aim is to show only 'A' when selected A cover type and B when slected B cover type...so on.... Also when selected ALL it should show A, B, C, D covergae type.
My code is like this but not working fully.
-DEFAULT &p_Covertype = ' A '; ( I can give value like B, C, D...so on)
-DEFAULT &p_WHEREDIDICLICK= 'gg'; ( it shoul give all covergae when ALL is given as value)
DEFINE FILE
aa, aoao,bb,bobo,cc,coco,dd,dodo
END
TABLE.....
PRINT
-IF &p_Covertype EQ 'A' THEN GOTO LBL_A;
-LBL_A
aa
aoao
-GOTO LBL_DWCTC;
-IF &p_WHEREDIDICLICK.QUOTEDSTRING EQ 'ALL' THEN GOTO LBL_ALLCOV;
- LBL_ALLCOV
aa,aoao,bb,bobo,cc,coco,dd,dodo
-GOTO LBL_DWCTC;
-IF &p_Covertype EQ 'B' THEN GOTO LBL_B;
-LBL_B
bb,bobo
-GOTO LBL_DWCTC;
-IF &p_WHEREDIDICLICK.QUOTEDSTRING EQ 'ALL' THEN GOTO LBL_ALLCOV;
aa,aoao,bb,bobo,cc,coco,dd,dodo
-GOTO LBL_DWCTC;
.......
BY
WHERE
STYLE
ENDSTYLE
END

NN

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


WebFOCUS 8
Windows 7
HTML
 
Posts: 50 | Registered: August 18, 2015Report This Post
Virtuoso
posted Hide Post
This looks like a spaghetti...

1- What are you CLEARY attempting to do?

2- It looks like you are trying to display only certain columns based on selection but also display them all according to another selection?

3- You have a loop in your GOTOs : "GOTO LBL_ALLCOV" exist twice in the same loop block.

4- You have -IF that go to the next line under the test which as no sense...

Suggestion : try to make a clear definition of your need and try to make sample with CAR file.
It may be clear in your head but it doesn't for me when looking at your example; getting more confused.


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
Virtuoso
posted Hide Post
To show or hide columns I usually set up a variable set to either blank or NOPRINT based on whatever logic you want and then put all the fields in one report with that variable. When the user says No, the variable will hide the field.

-SET &NP = IF &SHOW.(<Yes,Y>,<No,N>).Show Costs?. EQ 'N' THEN 'NOPRINT' ELSE '';
TABLE FILE CAR
SUM SALES 
RETAIL_COST &NP
DEALER_COST &NP
BY COUNTRY
BY CAR
END


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Gold member
posted Hide Post
Hello,
The code I gave was working before partly but it is missing some string.
let me be more simpler:
1. What are you CLEARY attempting to do? I am trying to select basing on certain selection.

-DEFAULT &p_Covertype = ' FN '
-IF &p_Covertype EQ 'A' THEN GOTO LBL_A;
-LBL_A
aa
bb
cc
-IF &p_Covertype EQ 'A' THEN GOTO LBL_B;

-LBL_B
GG
JJ
KK
But if All is selected it should give all type coverage. Lets assume there are A,B,C,D coverage type. I am doing it in Text Editor.


WebFOCUS 8
Windows 7
HTML
 
Posts: 50 | Registered: August 18, 2015Report This Post
Guru
posted Hide Post
N/A,

Read about FILTERING using WHERE and/or IF.


# SQL

SELECT * FROM YOUR_TABLE
WHERE coverage_type_field = 'A' --replace as need;

# FOCUS

TABLE FILE YOUR_TABLE
PRINT *
IF coverage_type_field EQ '&COVERAGE'
END

This will prompt to you type de desired value of &COVERAGE

This message has been edited. Last edited by: Ricardo Augusto,


WebFOCUS 8.1.05 / APP Studio
 
Posts: 272 | Location: Brazil | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
-DEFAULT &p_Covertype = ' FN '
-IF &p_Covertype NE 'A' THEN GOTO SKIP_A;
aa
bb
cc
-GOTO DONE;
-SKIP_A;
-IF &p_Covertype NE 'B' THEN GOTO SKIP_B;
GG
JJ
KK
-GOTO DONE;
-SKIP_B;
aa
bb
cc
GG
JJ
KK

-DONE;


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Gold member
posted Hide Post
SORRY. THERE WAS A TYPO
-DEFAULT &p_Covertype = ' FN '
-IF &p_Covertype EQ 'A' THEN GOTO LBL_A;
-LBL_A
aa
bb
cc
-IF &p_Covertype EQ 'B' THEN GOTO LBL_B;

-LBL_B
GG
JJ
KK
But if All is selected it should give all type coverage. Lets assume there are A,B,C,D coverage type. I am doing it in Text Editor.


WebFOCUS 8
Windows 7
HTML
 
Posts: 50 | Registered: August 18, 2015Report This Post
Virtuoso
posted Hide Post
Please look at the code above. Your IF THEN ELSE has to account for what happens when the variable EQ and NE to 'A'. What you have coded will not work.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Gold member
posted Hide Post
Hello Babak,
Thanks a lot! Yes I am getting some insight from your code but my requirements are not solved totally. May be I am not able to explain properly so I am going step by step.
-DEFAULT &p_Covertype = ' AssistedLivingCare '


-IF &p_Covertype EQ 'AssistedLivingCare' THEN GOTO LBL_ALC;
-LBL_ALC
ACCA
ACTP
-GOTO DONE;
-IF &p_Covertype EQ 'BusinessProperty' THEN GOTO LBL_BP;
-LBL_BP
BPC
BPAC
BPTP
-DONE;


Here if I put Assisted Living Care I am getting value but if I put Business Property I don't get value. There is something missing here.Please suggest. I have to make like 30 LBL like this.
please suggest and then I will ask my next requirements.


WebFOCUS 8
Windows 7
HTML
 
Posts: 50 | Registered: August 18, 2015Report This Post
Virtuoso
posted Hide Post
You haven't applied BabakNYC suggestion properly

-DEFAULT &p_Covertype = ' FN '
-IF &p_Covertype NE 'AssistedLivingCare' THEN GOTO SKIP_A;
ACCA
ACTP
-GOTO DONE;

-SKIP_A;
-IF &p_Covertype NE 'BusinessProperty' THEN GOTO SKIP_B;
BPC
BPAC
BPTP
-GOTO DONE;

-SKIP_B;
ACCA
ACTP
BPC
BPAC
BPTP

-DONE;


You should test with a NEGATIVE (IF test NE condition) logic to bypass what you don't want to be proceed.

Having a IF that go to the following lines just under the IF, makes no sense.

You have nothing displayed when you pass 'BusinessProperty' because your first "-IF &p_Covertype EQ 'AssistedLivingCare' " is not true so the GOTO is not performed but it still continue to the next lines and perform:
-LBL_ALC
ACCA
ACTP
-GOTO DONE;


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
Gold member
posted Hide Post
Thanks a Ton ! it really worked and worked. Good One


WebFOCUS 8
Windows 7
HTML
 
Posts: 50 | Registered: August 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     [SOLVED]Need help in coding....

Copyright © 1996-2020 Information Builders