Focal Point
Restricting the data in Hold file

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

June 17, 2008, 03:07 AM
basava
Restricting the data in Hold file
Hi,

i want to restrict the contents of Hold file while printing it.
For ex.
Content of hold file.

Accurate WTD
Agree 71%
Disagree 29%
StrongAgree 0%

I want to display as
Accurate WTD
Agree 71%
Disagree 29%

please suggest me in this regard.
June 17, 2008, 03:12 AM
GamP
Couldn't you do this with just using IF or WHERE selections?


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
June 17, 2008, 03:18 AM
basava
I have tried using WHERE but the desired result is not coming.
Can u suggest me a sample code Using IF.
June 17, 2008, 03:45 AM
Danny-SRL
Basava,
Could you post your code?


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

June 17, 2008, 04:28 AM
basava
Here is my code...

TABLE FILE T_ACC_QUALITY
SUM
COMPUTE WTD/D4% = IF (ACCURATE EQ 'Agree') THEN ((&AGR/&ACC) * 100) ELSE IF (ACCURATE EQ 'Disagree') THEN ((&DAGR/&ACC)*100) ELSE 0 ;
BY ACCURATE
-*ACROSS ACCURATE
WHERE MO_WK_I EQ &WK
ON TABLE HOLD AS H1
END

TABLE FILE H1
PRINT *
WHERE ACCURATE EQ 'Agree' AND ACCURATE EQ 'StronglyAgree'
END
-EXIT
June 17, 2008, 04:53 AM
Tewy
WHERE ACCURATE EQ 'Agree' AND ACCURATE EQ 'StronglyAgree'

Your where statement is asking for only records where the field ACCURATE equals both Agree and StronglyAgree (which isn't possible).

You need an OR:

WHERE ACCURATE EQ 'Agree' OR ACCURATE EQ 'StronglyAgree'


WF 7.6.11
Output: HTML, PDF, Excel
June 17, 2008, 06:21 AM
Tony A
quote:
I have tried using WHERE but the desired result is not coming.
Can u suggest me a sample code Using IF

Well done for demonstrating how much you need training. Check out the training centre links on the forum front page.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
June 17, 2008, 12:18 PM
Leah
Assuming you want to eliminate the 'StronglyAgree' give a WTD of zero values, look into using a WHERE TOTAL.


Leah
June 18, 2008, 09:33 AM
PBrightwell
quote:
COMPUTE WTD/D4% = IF (ACCURATE EQ 'Agree') THEN ((&AGR/&ACC) * 100) ELSE IF (ACCURATE EQ 'Disagree') THEN ((&DAGR/&ACC)*100) ELSE 0 ;

According to this, your 'StronglyAgree' will be zero.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes