Focal Point
[SOLVED] Breakdown report

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

February 09, 2012, 04:06 PM
BI_Developer
[SOLVED] Breakdown report
Hi

I am working on a break down report.

In main report there will be a total and when its clicked, break down of that total should be displayed. I am able to do this but I have a questions.

That total value is computed by sum of 25 fields. In a scenario 24 fields can have 0 and only 1 field can have value which makes up the total. In this scenario can only that value be shown? Basically I want to show only non-zero values (fields) which made the total. how can I achieve this?

Please suggest

Thankss

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


WF 8.2.01 APP STUDIO
PDF,HTML,EXL2K,Active
February 09, 2012, 04:20 PM
Waz
So you want to hide the 24 columns ?

The solution depends on your report layout and contents.

Are you are going to have some records with one non zero and others with more ?

Do you want to show non zero records when all records in the field are non zero, or on a record by record basis.

Are the 25 columns significant, can the non zero values be "compressed" to less columns, effectively hiding the zero values in the row.


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!

February 09, 2012, 04:32 PM
BI_Developer
Few records can have values in all 25 fields and few can have in 20, few can have in 5 etc.
all 25 columns are significant and need to be displayed if its non-zero. there is no specific layout, regular tabular report will go but should be horizontal rather than across.
When I click the drill down (total value) there is only 1 record with 25 fields. If I use OVER each field comes one below the other but I want to eliminate which have 0s.

quote:
Originally posted by Waz:
So you want to hide the 24 columns ?

The solution depends on your report layout and contents.

Are you are going to have some records with one non zero and others with more ?

Do you want to show non zero records when all records in the field are non zero, or on a record by record basis.

Are the 25 columns significant, can the non zero values be "compressed" to less columns, effectively hiding the zero values in the row.



WF 8.2.01 APP STUDIO
PDF,HTML,EXL2K,Active
February 09, 2012, 11:27 PM
Mika Keranen
Hi,

You could check the values of the 25 fields first and create a display/use flag for each and then do a second run for the actual display? I'm creating a 'comment it out'-flag, but you could also do a 'NOPRINT'-flag. Don't know whether there are stylesheet or other options to achieve this, but this is one way.

You need SET HOLDLIST = PRINTONLY to get only the COMPUTE fields in the SAVE file.

Cheers,
Mika

-SET &ECHO = ALL ;
-SET &COUNTRY = 'FRANCE' ;

SET HOLDLIST = PRINTONLY

TABLE FILE CAR
SUM COMPUTE X1/A2  = IF SEATS       NE 0 THEN '' ELSE '-*' ;
    COMPUTE X2/A2  = IF RETAIL_COST NE 0 THEN '' ELSE '-*' ;
    COMPUTE X3/A2  = IF DEALER_COST NE 0 THEN '' ELSE '-*' ;
    COMPUTE X4/A2  = IF SALES       NE 0 THEN '' ELSE '-*' ;
    COMPUTE X5/A2  = IF LENGTH      NE 0 THEN '' ELSE '-*' ;
    COMPUTE X6/A2  = IF WIDTH       NE 0 THEN '' ELSE '-*' ;
    COMPUTE X7/A2  = IF HEIGHT      NE 0 THEN '' ELSE '-*' ;
    COMPUTE X8/A2  = IF WEIGHT      NE 0 THEN '' ELSE '-*' ;
    COMPUTE X9/A2  = IF WHEELBASE   NE 0 THEN '' ELSE '-*' ;
    COMPUTE X10/A2 = IF FUEL_CAP    NE 0 THEN '' ELSE '-*' ;
WHERE COUNTRY EQ '&COUNTRY' ;
ON TABLE SAVE
END
-RUN
-READ SAVE &NP1.A2 &NP2.A2 &NP3.A2 &NP4.A2 &NP5.A2 &NP6.A2 &NP7.A2 &NP8.A2 &NP9.A2 &NP10.A2

TABLE FILE CAR
SUM
&NP1  SEATS       OVER
&NP2  DEALER_COST OVER
&NP3  RETAIL_COST OVER
&NP4  SALES       OVER
&NP5  LENGTH      OVER
&NP6  WIDTH       OVER
&NP7  HEIGHT      OVER
&NP8  WEIGHT      OVER
&NP9  WHEELBASE   OVER
&NP10 FUEL_CAP
WHERE COUNTRY EQ '&COUNTRY' ;
END
-RUN



WebFOCUS 7.6.x
PMF 5.2.x
February 10, 2012, 10:14 AM
BI_Developer
Thanks Mika. I use this logic many a times but I was hesitant to use the same for 25 fields. For now, I will go with this though.


WF 8.2.01 APP STUDIO
PDF,HTML,EXL2K,Active