Focal Point
[Solved] Referencing table cells when using SUM OVER ACROSS

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8551099192

July 18, 2008, 10:11 AM
slim007
[Solved] Referencing table cells when using SUM OVER ACROSS
I have a table that has titles going horizontally on the first row and titles going vertically on the first column. The data cells are made up of counts that are links to another focexec. The problem is that I do not know how to reference the individual data cells. Can anyone give me some guidance? I can provide some code if that helps.

Thanks...

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


7.1.4
UNIX
Excel, PDF, HTML
July 18, 2008, 10:28 AM
Tom Flynn
slim,

Search on ACROSSVALUE

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
July 18, 2008, 11:07 AM
BlueZone
If you are talking about referencing them in stylesheets, you could also try the FIELD=Px notation, where 'x' would be numerical number representing the order of Printed columns.

If you are not sure of the exact order, experiment with the following lines by changing the 'x' value to figure out how FOCUS is treating the cells in the background -

TYPE=DATA,COLUMN=P1,BACKCOLOR=YELLOW,$
TYPE=DATA,COLUMN=P2,BACKCOLOR=RED,$
TYPE=DATA,COLUMN=P3,BACKCOLOR=GREEN,$
....etc....

Sandeep Mamidenna


-------------------------------------------------------------------------------------------------
Blue Cross & Blue Shield of MS
WF.76-10 on (WS2003 + WebSphere) / EDA on z/OS + DB2 + MS-SQL
MRE, BID, Dev. Studio, Self-Service apps & a dash of fun !! Music
July 30, 2008, 11:54 AM
slim007
BlueZone,

I'm running into another problem. I have links for each cell for my across columns and I have a "WHEN=fieldname GT 0". So, the links only show up when the count is greater than zero. However, for some reason the link still shows up for some of the zero counts. Do you have any solution?

Thanks...


7.1.4
UNIX
Excel, PDF, HTML
July 30, 2008, 12:03 PM
Prarie
You may have the Columns referenced wrong. Try setting them to different colors so you can see which one is really which.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
Using the Px notation, I get the row for that columns I have. Do you know how to reference a particular cell? I have a table with 7 columns and 17 rows.

Thanks...


7.1.4
UNIX
Excel, PDF, HTML
Slim,

For multiple columns the syntax is usually TYPE=what ever, COLUMN=column(*), etc. etc.

Not sure if you can use a numeric instead of the asterisk but you could try it out.

I can't test it at home.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
Is this something like what you are trying to do?

TABLE FILE CAR
SUM RCOST OVER DCOST OVER SALES
BY MODEL
ACROSS BODYTYPE
ON TABLE SET STYLE *
TYPE=DATA, ACROSSCOLUMN=SALES, BACKCOLOR=GREEN, COLOR=WHITE, WHEN=SALES GT 0,$
ENDSTYLE
END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
Mickey,

This is exactly what I am trying to do. However, for some reason even though the column value, in your example "Sales" is 0, the "WHEN" does not work. Could there be some other value that could be overriding the 0? I am at a loss...

Thanks...


7.1.4
UNIX
Excel, PDF, HTML
Slim

Can't you post some code?
We might see what is wrong and an example of the report you need might help too. Create it in excel , make a screen print and show it.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

I have had trouble Making across work like this before.
This is how I made it work. Referencing CW in an Acrosscolumn would not work.

TYPE=DATA,COLOR='RED',COLUMN=N10,WHEN=CW LT 0,$
TYPE=DATA,COLOR='RED',COLUMN=N11,WHEN=CW LT 0,$
TYPE=DATA,COLOR='RED',COLUMN=N13,WHEN=CW LT 0,$
TYPE=DATA,COLOR='RED',COLUMN=N12,WHEN=CW LT 0,$
TYPE=DATA,COLOR='RED',COLUMN=N16,WHEN=CW LT 0,$
slim,

Does it work properly with the CAR file?


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
I finally got it work! Thanks for all your help! Smiler
Here is what my code looks like:

TYPE=DATA,COLOR='RED',ACROSSCOLUMN=N10,WHEN=N10 GT 0,$

Thanks Again!


7.1.4
UNIX
Excel, PDF, HTML
Well now that is interesting.
slim,

That's good to here.

Please edit the original post you started this thread with and add [SOLVED] to the subject title.

FYI, you can also use the fieldname in the ACROSSCOLUMN= statement and it should work as well AS LONG AS the fieldname is not referecned more than once in the SUM statement.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
What a great peice of information...I was driving my self crazy with an Across - and a red negative. I had
SUM NEWCOST
BY HIGHEST TOTAL NEWCOST
ACROSS SMARTDATE

and it was not working...read this helpful hint below...redefined the second NEWCOST to a different name....and it works! Thanks Mickey



quote:
LONG AS the fieldname is not referecned more than once in the SUM statement.