Focal Point
[CLOSED] Define file

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

March 31, 2015, 10:48 AM
QuickLearner
[CLOSED] Define file
Hello,

I wanted to know what are the other ways to count/SUM a group of numbers in the Define section without using "SUM", since it is not allowed. Please see below for query:

I WOULD JUST LIKE TO COUNT THE DISTINCT CASENUMBERS. THANK YOU



DEFINE FILE TISCDATA
SUM
CNT.DST.CASENUMBER/I9C AS 'CASECNT3'

END

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


WebFOCUS 7.6
Windows, All Outputs
March 31, 2015, 10:59 AM
MartinY
Should go back to your manual and training... cannot do
quote:
SUMCNT.DST.CASENUMBER/I9C AS 'CASECNT3'

in a DEFINE.

Seems that WF is still not 'fluid'...


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
March 31, 2015, 11:05 AM
QuickLearner
I under stand this cannot be done in a define. I wanted to know is there a work around method that is similar that can be done in a DEFINE.


WebFOCUS 7.6
Windows, All Outputs
March 31, 2015, 11:07 AM
QuickLearner
In the below code In order to do a count distinct, I need a SUM, but I need to use the PRINT to, is there any way I can use both or a work around.

TABLE FILE PSBASSGN
HEADING CENTER
"&SUB_ASG"
PRINT

UPLASTNAME AS ''


COMPUTE CASECNT3/D9= CNT.DST.CASENUMBER ;

I need this COMPUTE to work but it needs a SUM and I need the PRINT there, is there a way to use both or a work around.

Thank you


WebFOCUS 7.6
Windows, All Outputs
March 31, 2015, 11:17 AM
QuickLearner
How come this cant be done, I am getting a "The field name is not recognized: CASECNT3" error, could someone please advise as to what I am doing wrong. Why cant you use a SUM and PRINT at the same time like this...

 TABLE FILE  PSBASSGN
HEADING CENTER
"&SUB_ASG"
SUM 

CNT.DST.CASENUMBER/I9C AS 'CASECNT3'
PRINT


CASECNT3 AS 'Overdue'  



WebFOCUS 7.6
Windows, All Outputs
April 01, 2015, 12:51 PM
George Patton
I can't resist replying ..

It looks like you are simply trying to count the number of distinct cases that are overdue

TABLE FILE  PSBASSGN
HEADING CENTER
"&SUB_ASG"
SUM 
CNT.DST.CASENUMBER/I9C AS 'Overdue'
WHERE DUE_DATE LT SOME_DATE
END


I also can't resist pointing out that WebFOCUS cannot be mastered in two months as you initally thought. This is fairly basic stuff - even I can handle it with my elderly brain. You should seriously try to persuade your employer to send you on a couple of the courses. Unfortunately, I think they will probably concentrate on the GUI these days, but that's better than nothing. And if you hunt around in used book stores you might even find an old FOCUS manual somewhere, which would help a lot.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
April 03, 2015, 06:38 AM
Danny-SRL
As it is well known, in orer to learn quickly, one should explain slowly.
So:
1. Could you be a bit more explicit as to what you are aiming to do?
2. Do you have the PDF manuals of WebFOCUS, in particular "wf76crlang.pdf", which, once you studied it at length, would allow you to find the solution to your problem.
3. Have you ever followed some training? If not, I assure you that it helps.
4. A hint for you: look up "multi-set request", or, if you are a pure GUI (or should one say gooey) user, look up "sort groups".


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

April 03, 2015, 06:54 AM
WebFOCUS Exp
Hi Quicklearner,

You can use Multi Verb to achieve that. WebFOCUS is a vast thing and it takes time to learn. If you need any online training or dedicated time for help, connect to me on ibiwebfocus1@gmail.com.

Thanks,
WebFOCUS Experts


WebFOCUS 7.7.03
Windows
Excel, HTML, PDF, AHTML, PPT
April 03, 2015, 08:00 PM
George Patton
quote:
I WOULD JUST LIKE TO COUNT THE DISTINCT CASENUMBERS. THANK YOU

No multi-verb request needed ....


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
April 06, 2015, 09:08 AM
jgelona
Or
TABLE FILE XXXX
COUNT DST.CASENUMBER/I9 AS 'Overdue'
WHERE ...
END


Many of the manuals are available for download on IBI's site. They can be hard to find.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
April 07, 2015, 04:02 AM
Dave
I think we need to back up a few miles...

@Quicklearner
SUM is an abbriviation of SUMMARIZE ( not just SUM ).
e.g. it aggregates all values within the stated BY fields values.

It is not just aggregated, it's also displayed ( "printed" if you like ).

Within SUM you can use MAX. MIN. CNT. and even CNT.DST.
this tells WF what to do with all the values found within the same BY field values.

e.g.
TABLE FILE CAR
SUM SALES AS 'All sales added up'
    CNT.DST.CAR AS 'unique number of cars'
    MAX.SEATS AS 'Maximum number of seats found'
BY  COUNTRY
END


...
my guess:

TABLE FILE PSBASSGN
SUM CNT.DST.CASENUMBER AS 'Overdue'
BY  UPLASTNAME AS ''
END


This will count the unique number of cases for each UPLASTNAME.

G'luck,
Dave


_____________________
WF: 8.0.0.9 > going 8.2.0.5