Focal Point
[SOLVED] DEFMACRO - 2 conditions

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

February 05, 2015, 10:35 AM
Susan M
[SOLVED] DEFMACRO - 2 conditions
Has anyone been able to successfully define 2 conditions on a DEFMACRO?
Currently I'm asking to color a field when less than another field. I would also like to only include this where N4 field is equal to 'O'.


$
DEFMACRO=COND0001,
MACTYPE=RULE,
WHEN=N5 LT N6,

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 8
Windows, All Outputs
February 05, 2015, 11:18 AM
eric.woerle
I can't remember if I've ever tried to do 2 conditions in a when statement, but I have put the condition into a define with an output of "Y" or "N" and then used the result of the define as my WHEN Condition.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
February 05, 2015, 11:20 AM
MartinY
DEFINE FILE X
CND /I1 = IF N5 LT N6 AND N4 EQ 0 THEN 1 ELSE 0;
END

TABLE FILE X
PRINT CND NOPRINT
...

DEFMACRO=COND0001,
 MACTYPE=RULE,
 WHEN=CND EQ 1,
$
...
END


Must work.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
February 05, 2015, 11:55 AM
Susan M
Great! I'll give it a shot. thank you!


WebFOCUS 8
Windows, All Outputs
February 05, 2015, 12:54 PM
Danny-SRL
I would rather use a COMPUTE.


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

February 05, 2015, 01:04 PM
Susan M
Just completed the mods to include the define and it works perfectly.
thank you all for the suggestions.


WebFOCUS 8
Windows, All Outputs
February 09, 2015, 12:55 AM
Ram Prasad E
Conditional styling using WHEN will support evaluation of one condition only. So in case of more than 1 condition, either use DEFINE or COMPUTE(use COMPUTE for better performance).

Thanks,
Ram


WebFOCUS 8.1.05
Windows
http://ibiwebfocus.wordpress.com
https://www.facebook.com/groups/ibi.webfocus/
November 22, 2019, 03:19 PM
J.Hines
Just a word of caution, as I'm just now finding this out after a crap-ton of digging.

I was getting "Unreadable Content" errors in my Excel reports, and I've now narrowed it down to the cause being that if you have


Most of my reports use EMPTYREPORT=ON (don't ask), but in this case, apparently WebFOCUS can't handle it when the WHEN clause in the DEFMACRO uses a compute field that's blank.

Unfortunately, I can't just set EMPTYREPORT=OFF, because this is the first report in a set of compound reports, and I at least need it to do `FORMAT XLSX OPEN AS report_name`.



Prod: 8.2.0.4 OS:Windows 10 Output:AHTML, Excel 2007+

The life of a designer is a life of fight against the ugliness.