Focal Point
[SOLVED]Returning a single row

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

July 13, 2016, 01:53 PM
Trudy
[SOLVED]Returning a single row
I have a procedure that returns multiple rows per ID that counts the number of times the record has been pulled using the following computed logic

HoldCnt/I2=  IF LAST ID EQ ID THEN LAST HoldCnt + 1 ELSE 1 


So my records look like
ID HoldCnt

332 1
332 2
332 3
654 1
654 2
912 1
912 2
912 3
912 4

I want the output to be

ID HoldCnt
332 3
654 2
912 4

Can anyone help with this?

Thanks

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


WF8
Windows
July 13, 2016, 02:11 PM
RSquared
Use the SUM command
SUM MAX.HOLDCNT BY ID;


OR
Just do

SUM CNT.ID BY ID


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
July 13, 2016, 02:38 PM
Trudy
The
 SUM CNT.ID BY ID  


worked. Didn't really see how I could do the MAX on a COMPUTED field, or am I missing something?


WF8
Windows
July 14, 2016, 02:08 PM
RSquared
I wasn't sure if it was a defined field or a computed field. I know it works for defined fields, you can try for a computed field.


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit