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] Supress columns with nodata(null)

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Supress columns with nodata(null)
 Login/Join
 
Gold member
posted
Hi Team,


I searched in forum and i could not get exactly what i need.So posting here for help.


I created a PDF report.

In this report i have to suppress the columns if no data is there in it.

Example:
C1 |C2 |C3 |C4
1 | 2 | 3
4 | 5 |
6 | 7 |
8 |

Now i have to suppress Column4.

My data should look like following

C1 |C2 |C3
1 |2 | 3
4 |5 |
6 |7 |
8



Note:My report does not have any ACROSS fields.


Any suggestions will be great help for me guys...Thanks in advance.

Thanks,
rakesh

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 8.0.03
Windows, All Outputs
 
Posts: 59 | Registered: February 13, 2014Report This Post
Expert
posted Hide Post
To show C4, change to 1 or 2 or 3, etc...
To not show C4, keep at ZERO...
  
DEFINE FILE IBISAMP/CAR
  C1/I5 WITH CAR   = C1 + 1;
  C2/I5 WITH SEATS = C2 + 1;
  C3/I5 WITH CAR   = C3 + 1;
  C4/I5 WITH CAR   = 0;
END

TABLE FILE IBISAMP/CAR
SUM
    C1
    C2
    C3
    C4
   BY COUNTRY
 ON TABLE HOLD FORMAT ALPHA
END
-RUN
TABLE FILE HOLD
SUM
    MAX.C1
    MAX.C2    
    MAX.C3    
    MAX.C4
  ON TABLE HOLD AS MAXVALUE FORMAT ALPHA
END
-RUN
-READFILE MAXVALUE
-SET &SHOW_C1 = IF &C1 NE 0 THEN 'C1' ELSE '';
-SET &SHOW_C2 = IF &C2 NE 0 THEN 'C2' ELSE '';
-SET &SHOW_C3 = IF &C3 NE 0 THEN 'C3' ELSE '';
-SET &SHOW_C4 = IF &C4 NE 0 THEN 'C4' ELSE '';
TABLE FILE HOLD
SUM
   &SHOW_C1.EVAL
   &SHOW_C2.EVAL
   &SHOW_C3.EVAL
   &SHOW_C4.EVAL
  BY COUNTRY
 ON TABLE PCHOLD FORMAT HTMTABLE
END
-EXIT


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Virtuoso
posted Hide Post
Tom,
Very nice!
With a bit of trickery ( Big Grin), one pass on the data:
  
-SET &ECHO=ALL;
-* File rakesh01.fex
DEFINE FILE CAR
  V1/I5 WITH CAR   = V1 + 1;
  V2/I5 WITH SEATS = V2 + 1;
  V3/I5 WITH CAR   = 0;
  V4/I5 WITH MODEL   = V4 + 1;
END

TABLE FILE CAR
SUM 
MAX.V1 NOPRINT
MAX.V2 NOPRINT
MAX.V3 NOPRINT
MAX.V4 NOPRINT
SUM
    V1
    V2
    V3
    V4
   BY COUNTRY
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
 INCLUDE=ENDEFLT,
$
-REPEAT #ZERO FOR &I FROM 1 TO 4;
TYPE=DATA, COLUMN=V&I, SIZE=1, WHEN=MAX.V&I EQ 0, 
$
TYPE=TITLE,COLUMN=V&I, SIZE=1, WHEN=MAX.V&I EQ 0, 
$
-#ZERO 
ENDSTYLE
END


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Gold member
posted Hide Post
Thanks TOM and DANNY for your very Quick Response..

Your examples are good .
This is how my data looks like...


[IMG:left] [/IMG]

This what i need



Thanks guys...

Waiting for valid inputs..

Thansk,
rakesh


WebFOCUS 8.0.03
Windows, All Outputs
 
Posts: 59 | Registered: February 13, 2014Report This Post
Virtuoso
posted Hide Post
Well, Rakesh, did you try using Tom's method? Or mine?


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Gold member
posted Hide Post
I tried both,but my columns are date columns and the number of columns depends on prompt value select..

Its not supress one column

I posted images of what i need ,Can you guys help me out to acheive this..


WebFOCUS 8.0.03
Windows, All Outputs
 
Posts: 59 | Registered: February 13, 2014Report This Post
Virtuoso
posted Hide Post
Ok Rakesh,

I see you sort your output by ID and you have a number of fields called RUN1 thru RUNx.
What is the PROMPT that you receive? The number of RUNs?


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Gold member
posted Hide Post
danny

my prompt is not number of runs.if that is the case I can do it easily.

my prompt is some text value.. Can you help me to do this..


WebFOCUS 8.0.03
Windows, All Outputs
 
Posts: 59 | Registered: February 13, 2014Report This Post
Virtuoso
posted Hide Post
Rakesh,
So what is your input?
And why can't you use what has been suggested?
Can you be a bit more specific?


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Virtuoso
posted Hide Post
Rakesh,

Assuming (very dangerous to assume!) that in your procedure you have the different RUN fields and that they are FOCUS dates, here is another solution:
  
-SET &ECHO=ALL;
-* File rakesh01.fex
DEFINE FILE CAR
RUN0/DMYY='19/04/2014';
NUM/I3 WITH COUNTRY = NUM + 1;
RUN1/DMYY=RUN0 + NUM;
RUN2/DMYY=RUN0 + NUM*2;
RUN4/DMYY=RUN0 + NUM*7;
RUN3/DMYY=0;
END
TABLE FILE CAR
SUM
    RUN1
    RUN2
    RUN3
    RUN4
   BY COUNTRY
ON TABLE SAVE AS RAK FORMAT ALPHA
END
-RUN
EX -LINES 7 EDAPUT MASTER,RAK,C,MEM
FILENAME=RAK, SUFFIX=FIX
 SEGNAME=RAK, SEGTYPE=S0
  FIELDNAME=COUNTRY, COUNTRY, A10, A10, $
 SEGNAME=RUN, SEGTYPE=S0, PARENT=RAK, OCCURS=VARIABLE
  FIELDNAME=RUN, RUN, DMYY, A8, $
  FIELDNAME=CNTR, ORDER, I2, I4,$
-RUN
DEFINE FILE RAK
RNUM/A5='RUN' | EDIT(CNTR);
END
-RUN
SET ACROSSTITLE = SIDE
TABLE FILE RAK
SUM RUN
BY COUNTRY
ACROSS RNUM AS ''
IF RUN NE '31/12/1900';
ON TABLE SET HTMLCSS ON
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET STYLE *
 INCLUDE=ENDEFLT,
$
ENDSTYLE
END


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Virtuoso
posted Hide Post
In your example, you want to avoid generating columns for RUN4 through RUN7 in your output, since their values are Null in every row. That can be accomplished in a number of ways, all of which would require use of dialog manager to dynamically control the list of verb objects in the TABLE request -- either to generate the lines of code listing the verb-objects (generating a blank line for the ones that are found to be all-null), or to conditionally insert keywords (NOPRINT or FOC_NONE) to obtain the same effect)

So you need to add a preprocessing step, before the TABLE request, that will define the necessary amper variables. There are a number of ways to skin the cat, but basically you need to define or compute a control variables for each column that may need to be suppressed, HOLD them in a SUM request, use -READFILE to render the control variables as amper variables, and then reference them in the TABLE request that delivers the report.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Gold member
posted Hide Post
Hi Danny,

Thanks for the patience.

My question is simple but solution i could not acheive exactly.

I am trying this from past one and half week,but i could not.
Only hope is Focal Point forum.
I dont have any other help.So can you guys make help me.

Let me make you clear.

I have SQL Report where it will is one ID value column and multiple RunDates coulumn in dd-mon-yyyy format.

I need to suppress the columns if it has entire NULLS in it.

With your static example you hard coded('19/04/2014') and added and acheived but in my case i could not.


Can you guys help me.

Thanks in advance.


WebFOCUS 8.0.03
Windows, All Outputs
 
Posts: 59 | Registered: February 13, 2014Report This Post
Gold member
posted Hide Post
Hi Jack,

Can you post some example elaborating your explanation.

It would be great help for me.


Thanks in advance
Rak


WebFOCUS 8.0.03
Windows, All Outputs
 
Posts: 59 | Registered: February 13, 2014Report This Post
Expert
posted Hide Post
-* fpRakesh1.fex

-SET &ECHO=ALL;

SET ASNAMES=ON
SET HOLDLIST=PRINTONLY
SET HOLDFORMAT=ALPHA
SET NODATA=NULL
-RUN

FILEDEF FPRAKESH1 DISK fprakesh1.txt
-RUN

-WRITE FPRAKESH1  1 20110919 20120109 20120407 .        .        .        .
-WRITE FPRAKESH1  2 20110919 20120123 20120709 .        .        .        .
-WRITE FPRAKESH1  3 20110926 20120130 20121224 .        .        .        .
-WRITE FPRAKESH1  4 20111003 20120305 20120716 .        .        .        .
-WRITE FPRAKESH1  5 20111017 20120326 20130107 .        .        .        .
-WRITE FPRAKESH1  6 20111010 20120312 20120723 .        .        .        .
-WRITE FPRAKESH1  7 20111024 20120423 20130128 .        .        .        .
-WRITE FPRAKESH1  8 20111031 20120521 20121231 .        .        .        .
-WRITE FPRAKESH1  9 20111107 20120528 .        .        .        .        .
-WRITE FPRAKESH1 10 20111114 20120604 .        .        .        .        .
-WRITE FPRAKESH1 11 20111121 20120611 .        .        .        .        .
-WRITE FPRAKESH1 12 20111205 20120618 .        .        .        .        .
-WRITE FPRAKESH1 13 20120102 20120625 .        .        .        .        .
-WRITE FPRAKESH1 14 20120116 20120702 .        .        .        .        .
-WRITE FPRAKESH1 15 20120220 20120813 .        .        .        .        .
-WRITE FPRAKESH1 16 20120213 20121224 .        .        .        .        .

FILEDEF MASTER DISK fprakesh1.mas
-RUN

-WRITE MASTER FILENAME=FPRAKESH1, SUFFIX=FIX, $
-WRITE MASTER SEGNAME=FPRAKESH1, $
-WRITE MASTER FIELDNAME=ID, FORMAT=I2, ACTUAL=A2, MISSING=ON, $
-WRITE MASTER FIELDNAME=FILLER1, FORMAT=A1, ACTUAL=A1, $
-WRITE MASTER FIELDNAME=RUN1, FORMAT=YYMD, ACTUAL=A8YYMD, MISSING=ON, $
-WRITE MASTER FIELDNAME=FILLER2, FORMAT=A1, ACTUAL=A1, $
-WRITE MASTER FIELDNAME=RUN2, FORMAT=YYMD, ACTUAL=A8YYMD, MISSING=ON, $
-WRITE MASTER FIELDNAME=FILLER3, FORMAT=A1, ACTUAL=A1, $
-WRITE MASTER FIELDNAME=RUN3, FORMAT=YYMD, ACTUAL=A8YYMD, MISSING=ON, $
-WRITE MASTER FIELDNAME=FILLER4, FORMAT=A1, ACTUAL=A1, $
-WRITE MASTER FIELDNAME=RUN4, FORMAT=YYMD, ACTUAL=A8YYMD, MISSING=ON, $
-WRITE MASTER FIELDNAME=FILLER5, FORMAT=A1, ACTUAL=A1, $
-WRITE MASTER FIELDNAME=RUN5, FORMAT=YYMD, ACTUAL=A8YYMD, MISSING=ON, $
-WRITE MASTER FIELDNAME=FILLER6, FORMAT=A1, ACTUAL=A1, $
-WRITE MASTER FIELDNAME=RUN6, FORMAT=YYMD, ACTUAL=A8YYMD, MISSING=ON, $
-WRITE MASTER FIELDNAME=FILLER7, FORMAT=A1, ACTUAL=A1, $
-WRITE MASTER FIELDNAME=RUN7, FORMAT=YYMD, ACTUAL=A8YYMD, MISSING=ON, $
-RUN

TABLE FILE FPRAKESH1
SUM
MIN.RUN1
MIN.RUN2
MIN.RUN3
MIN.RUN4
MIN.RUN5
MIN.RUN6
MIN.RUN7

ON TABLE HOLD AS HRAKESH1
END
-RUN

-READ HRAKESH1 &RUN1.A8. &RUN2.A8. &RUN3.A8. &RUN4.A8. &RUN5.A8. &RUN6.A8. &RUN7.A8.

-? &RUN

-SET &COLRUN1 = IF &RUN1 EQ '.' THEN '' ELSE 'RUN1';
-SET &COLRUN2 = IF &RUN2 EQ '.' THEN '' ELSE 'RUN2';
-SET &COLRUN3 = IF &RUN3 EQ '.' THEN '' ELSE 'RUN3';
-SET &COLRUN4 = IF &RUN4 EQ '.' THEN '' ELSE 'RUN4';
-SET &COLRUN5 = IF &RUN5 EQ '.' THEN '' ELSE 'RUN5';
-SET &COLRUN6 = IF &RUN6 EQ '.' THEN '' ELSE 'RUN6';
-SET &COLRUN7 = IF &RUN7 EQ '.' THEN '' ELSE 'RUN7';

TABLE FILE FPRAKESH1
PRINT
&COLRUN1
&COLRUN2
&COLRUN3
&COLRUN4
&COLRUN5
&COLRUN6
&COLRUN7
BY ID
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
Virtuoso
posted Hide Post
Rakesh,
Why don't you post the code that produces your output? Then maybe we can play with it.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Virtuoso
posted Hide Post
quote:
Originally posted by Rakesh Boddu:
Hi Jack,

Can you post some example elaborating your explanation.


Rakesh --

Sorry for the delay. Here's how I would do it (the code is untested)
DEFINE FILE xxx
  date1count/I6=IF RUN1 IS MISSING THEN 0 ELSE 1;
  date2count/I6=IF RUN2 IS MISSING THEN 0 ELSE 1;
  date3count/I6=IF RUN3 IS MISSING THEN 0 ELSE 1;
  . . .
END

TABLE FILE xxx
SUM COMPUTE
  date1print/A8=IF SUM.date1count EQ 0 THEN 'NOPRINT' ELSE ' ';
  date2print/A8=IF SUM.date2count EQ 0 THEN 'NOPRINT' ELSE ' ';
  date3print/A8=IF SUM.date3count EQ 0 THEN 'NOPRINT' ELSE ' ';
  . . .
ON TABLE HOLD AS 'CONTROL'
END
-RUN
-READFILE CONTROL
-? &date
TABLE FILE xxx
SUM
  RUN1 &date1print
  RUN2 &date2print
  RUN2 &date3print
    etc.
BY ID
. . .
END



Note to the regulars:
I believe the same idea will work using FOC_NONE rather than NOPRINT; if you truncate the control variables and append them to the column-heading
 RUN1 AS 'HEADING,FOR DATE 1&date1print'

then you may be able to preserve GUI-compatibility, with minimal effect on the report (adding one trailing space to headings).


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Gold member
posted Hide Post
Thanks Gross.

I will try this.


WebFOCUS 8.0.03
Windows, All Outputs
 
Posts: 59 | Registered: February 13, 2014Report This Post
Virtuoso
posted Hide Post
Nu? So, what happened?
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 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     [SOLVED] Supress columns with nodata(null)

Copyright © 1996-2020 Information Builders