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] Column references in COMPUTE affected by left arrow/caret

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Column references in COMPUTE affected by left arrow/caret
 Login/Join
 
Member
posted
My column references are not returning the values I expect when I have
Here is example code:

 
TABLE FILE CAR
SUM SALES
ACROSS COUNTRY
COMPUTE 
COL1/D10 = C1;
COL2/D10 = C2; 

FOOTING BOTTOM
"Page <TABPAGENO of <TABLASTPAGE"

END


I expected C1 and C2 to reference the first and second columns, respectively. This is true when I don't include any "<" in my code. When I do have "<" in my code, C1 returns the value from the third column and C2 returns the value from the fourth column [or they return 0 when there are 2 or fewer columns in the report).

I can't figure out why the column references get shifted over by two columns. Any help would be much appreciated!

This message has been edited. Last edited by: Jamie K.,


WebFOCUS 8.103
Windows 2008
Excel, PDF, HTML
 
Posts: 15 | Location: Vancouver, BC | Registered: November 20, 2013Report This Post
Master
posted Hide Post
Jamie,

I do know WF sometimes adds extra columns to the internal matrix when it needs the data.

TABLE FILE CAR
 SUM SALES
 COMPUTE Q = SEAT * SALES;
BY CAR
END


in this case
C1 = SALES
C2 = SEATS ( ! )
C3 = Q

although I can not reproduce it here. I'm pretty sure something like that is also done to provide the data shown in footers and headers.

I've tried your code. Both with < and without <. Both give the same output.


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Virtuoso
posted Hide Post
Hi Jamie, Dave is right and I also think that in this case you have to count first from the ACROSS (which is kind of BY). So C1 = SALES sum of first COUNTRY, C2 = SALES sum of second COUNTRY and so on.
TABLE FILE CAR
SUM SALES
ACROSS COUNTRY
COMPUTE COL1/D10 = C1;
        COL2/D10 = C2;
        COL3/D10 = C3;
        COL4/D10 = C4;
        COL5/D10 = C5;
END


But as Dave mentioned, I don't see either any differences with or without
<
. Maybe we haven't understand what you mean. Post both your code with and without
<
.


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
The ACROSS measures (SALES specific to each COUNTRY value, in Martin's example) are not part of the internal matrix that is populated from the incoming data values. (That structure treats ACROSS as BY, hence it has but one column associated with SALES.)

When you make explicit reference to columns of the final report using Column notation, whether in a COMPUTE or in a "<" reference, the referenced column must be instantiated in the internal matrix; it gets added as a hidden verb object [much like real incoming columns referenced in COMPUTE and not appearing as an explicit verb-object).

That's apparently why the caret references affect the column-index assignment.
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Member
posted Hide Post
Thank you all for your input.

Here is a picture of my output. The first table doesn't have any carets in the code and the second one does. The column reference gets shifted over by the number of carets (2 in this case).
Image and video hosting by TinyPic

If I must include these two carets in my code, how will I reference the first two columns of the report? I was keeping my fingers crossed that indices of 0 and -1 would work but they don't.

I thought I had updated my profile to reflect the version of WF that I'm on but it still says 8.007. I'm using AppStudio 8.103. I wonder if my problem has to do with this version since I've never had any problems with column references in previous versions... and that might explain why you are seeing the same output with and without the caret.


WebFOCUS 8.103
Windows 2008
Excel, PDF, HTML
 
Posts: 15 | Location: Vancouver, BC | Registered: November 20, 2013Report This Post
Expert
posted Hide Post
I avoid using column notation - there are extremely few cases where this is necessary.


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
Expert
posted Hide Post
I see what you see , and i'm in 7706 server

i tried your example, just using just one of the tab variables.
still offset by 2

England is just gone!
if only Chapuys had known...




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
ah it gets wierder.
If you use a BY field
you get ENGLAND back, but then Column 2 is Japan, and Column 3 is W Germany.
try it.
oh this is very strange
DEFINE FILE ibisamp/CAR
DUMMY/A1 WITH CAR = ' ';
END
TABLE FILE ibisamp/CAR

SUM SALES
BY DUMMY  
ACROSS COUNTRY
COMPUTE 
 
COL1/D10 = C1;
        COL2/D10 = C2;
        COL3/D10 = C3;
        COL4/D10 = C4;
        COL5/D10 = C5;
 
ON TABLE SET HOLDLIST PRINTONLY
 FOOTING
"  <TABPAGENO  of <TABLASTPAGE "
END


I just tried it in 768 and it works fine.
so this is a bug, and a big nasty virus-carrying one. I think you should get an award, Vancouver, for discovering it!




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Virtuoso
posted Hide Post
Jamie,
No problem in 8007.
I would venture that in your version the fields in the FOOTING wreak a bit of havoc in the internal matrix.
Yikes!
Sweating


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
Member
posted Hide Post
It does get weirder with BY fields!

I found that if I first put my results in a hold table and then compute off the hold table, the column references are all correct, even when I have carets in the footing. I guess this is what I'll do until I find a cleaner solution.

Have a great weekend everyone!


WebFOCUS 8.103
Windows 2008
Excel, PDF, HTML
 
Posts: 15 | Location: Vancouver, BC | Registered: November 20, 2013Report 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] Column references in COMPUTE affected by left arrow/caret

Copyright © 1996-2020 Information Builders