Focal Point
Another question for previous problem

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

May 22, 2006, 03:07 PM
Mchll
Another question for previous problem
The data I'm using to do a counter on is very large. What I'm guessing I need to do is create a hold file with just the records I need to run the report on then do a counter on the hold file?? Can that be done? Thanks in advance, been a while since I went to training and there's no one here that knows. : (
May 22, 2006, 03:13 PM
susannah
without knowing what your previous problem was, actually, the answer to this questions is yes indeed.
TABLE FILE CAR
SUM somethings
IF someconditions
ON TABLE HOLD
END
TABLE FILE HOLD
COUNT something
...
END




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
May 22, 2006, 03:21 PM
Mchll
Thanks for the speedy responce
May 22, 2006, 04:13 PM
dwf
Mchll,

Does this not work for you?

TABLE FILE CAR
COUNT something
IF someconditions
END

I can't imagine why not, unless you're getting asterisks in the count field. If that's all that's going on, change the count command to:

COUNT something/I9C

If something else is going on, I'd be curious what it is.


dwf
May 22, 2006, 04:38 PM
Mchll
The hold file worked.
My previous question was: "I have some data that has equipment for accounts, about 12,000 records. Most of the accounts have more than one piece of equipment and I need to sum the data so that there's one account with each different type of equipment concatinated into one column. My thought is to index and run the data through a loop to concatinate the equipment types."

Here's what I I have so far:
APP PATH 1STAR

DEFINE FILE TASQ_DAILY_SHIPPING
SDATE/YYMD = HDATE(SHIP_DATE,'YYMD') ;
XSDATE/MDY = SDATE ;
END

TABLE FILE TASQ_DAILY_SHIPPING
SUM
XSDATE
PART_ID
BY
MERCHANT_NUMBER
IF XSDATE GE '05/15/2006'
ON TABLE HOLD
END

DEFINE FILE HOLD
CNTR/I1=IF MERCHANT_NUMBER EQ LAST MERCHANT_NUMBER AND PART_ID NE LAST PART_ID THEN CNTR + 1
ELSE 1;
END
TABLE FILE HOLD
WRITE PART_ID
ACROSS CNTR NOPRINT BY MERCHANT_NUMBER
END

This worked ok but it did not concatinate the part id's.
May 22, 2006, 04:57 PM
dwf
I can't quite tell from your response whether you have a partial or complete solution. Your respne started with 'The hold file worked' and ended with 'This worked ok but it did not concatenae the part id's'. Can't tell if that last statement is from your latest post or the previous post to which you alluded. If you don't post anything else, I will assume you have a complete solution.


dwf
May 22, 2006, 05:07 PM
Mchll
I'm not the best communicator, sorry. My problem is not really solved. I have not been able to get the one merchant number with all part ids in one column. I no longer have multiple rows per merchant but I have no idea what happened to the other part id's. No worries.
May 22, 2006, 05:20 PM
dwf
What happened is that you summed part id by merchant. I assume part id is alhpanumeric, in which case focus grabbed the last one for each merchant, and ignored the rest.

I may be off the track here, but the code below might get you started in the right direction (without a hold). It assumes merchant number is numeric and part id is alpha. If they are both alpha, then you don't need MERCHNUM. This ought to give you all parts, though you'll see one line per merchant/part.

Are you looking for something different?

APP PATH 1STAR

DEFINE FILE TASQ_DAILY_SHIPPING
SDATE/YYMD = HDATE(SHIP_DATE,'YYMD') ;
XSDATE/MDY = SDATE ;
MERCHNUM/A10 = EDIT(MERCHANT_NUMBER);
MERCH_PART/A21 = MERCHNUM | ' ' | PART_ID;
END

TABLE FILE TASQ_DAILY_SHIPPING
SUM
XSDATE
COMPUTE
CNTR/I9C=IF MERCHANT_NUMBER EQ LAST MERCHANT_NUMBER THEN CNTR + 1 ELSE 1;
BY MERCH_PART AS 'Merchant - Part'
IF XSDATE GE '05/15/2006'
END


dwf
May 22, 2006, 05:29 PM
Mchll
I'll give it a try tomorrow. Thanks for helping, I do appreciate it. Have a good night.
May 22, 2006, 05:29 PM
dwf
I have thought some about my last reply. I don't think it will give you quite what you want. I wonder if this will solve your problem in a different way:

APP PATH 1STAR

DEFINE FILE TASQ_DAILY_SHIPPING
SDATE/YYMD = HDATE(SHIP_DATE,'YYMD') ;
XSDATE/MDY = SDATE ;
END

TABLE FILE TASQ_DAILY_SHIPPING
COUNT
PART_ID
BY MERCHANT_NUMBER
PRINT
XSDATE
BY MERCHANT_NUMBER
BY PART_ID
IF XSDATE GE '05/15/2006'
END

This is a very different animal. But if you want to see a cout of parts by merchant, and you want the parts listed, this might be what you are looking for.


dwf
May 23, 2006, 12:11 PM
Mchll
I haven't had a chance to try yet, I will soon. Thanks again for helping out!