Focal Point
[CLOSED] Help with OVER/ACROSS.

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

August 20, 2009, 08:38 PM
dz
[CLOSED] Help with OVER/ACROSS.
Got confused with the following:

TABLE FILE HR
PRINT SALARY OVER
BONUS
BY YEAR NOPRINT
ACROSS YEAR
END

Result:

2008 2009
------ ----
SALARY 10,000
BONUS 20,000
SALARY 15,000
BONUS 25,000


But I need:


2008 2009
------ ----
SALARY 10,000 15,000
BONUS 20,000 25,000


Please help.

This message has been edited. Last edited by: Kerry,
August 20, 2009, 08:55 PM
Waz
Take the BY YEAR NOPRINT out, and change PRINT to SUM.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

August 20, 2009, 09:36 PM
dz
Thanks, that worked. But if I wanted the year columns to be listed in different order. Can it be done?
August 20, 2009, 09:51 PM
Waz
This question was asked in the last couple of weeks I think.

This depends on the order you want.
TABLE FILE CAR
SUM SALES
ACROSS COUNTRY
END

TABLE FILE CAR
SUM SALES
ACROSS HIGHEST COUNTRY
END

TABLE FILE CAR
SUM SALES
ACROSS COUNTRY COLUMNS 'FRANCE' AND 'W GERMANY' AND 'ITALY' AND 'JAPAN' AND 'ENGLAND' 
END



Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

August 20, 2009, 09:54 PM
dz
Thanks. I'll try that.
August 22, 2009, 07:38 AM
dz
I tried to use "ACROSS COUNTRY COLUMNS 'FRANCE' AND 'W GERMANY' AND 'ITALY' AND 'JAPAN' AND 'ENGLAND'" but developer's studio ignores and removes this code completely. Is there another way to do this?
August 28, 2009, 11:21 AM
Kerry
Hi dz,

Please try the following:

DEFINE FILE  CAR
SORT/I9= DECODE COUNTRY('JAPAN' 1 'ENGLAND' 2 'ITALY' 3 'FRANCE' 4 'W GERMANY' 5 ELSE 0);
END
 
TABLE FILE CAR
SUM   DEALER_COST
       RETAIL_COST
ACROSS SORT     NOPRINT  
ACROSS COUNTRY
BY CAR
 
END


Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
August 28, 2009, 11:29 AM
GamP
The GUI side of DevStudio is not really capable of understanding everything us die-hard coders manage to come up with.
ACROSS COLUMNS is one of the things that's not in it. So you'll either have to revert to Kerry's solution, which is 'clickable' or do without the gui thing for this procedure.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988