Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] DEFMACRO - 2 conditions
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] DEFMACRO - 2 conditions
 Login/Join
 
Member
posted
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
 
Posts: 3 | Registered: February 04, 2015Reply With QuoteReport This Post
Master
posted Hide Post
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
 
Posts: 750 | Location: Warrenville, IL | Registered: January 08, 2013Reply With QuoteReport This Post
Virtuoso
posted Hide Post
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.0.1M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2241 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport This Post
Member
posted Hide Post
Great! I'll give it a shot. thank you!


WebFOCUS 8
Windows, All Outputs
 
Posts: 3 | Registered: February 04, 2015Reply With QuoteReport This Post
Virtuoso
posted Hide Post
I would rather use a COMPUTE.


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

 
Posts: 1937 | Location: Tel Aviv, Israel | Registered: March 23, 2006Reply With QuoteReport This Post
Member
posted Hide Post
Just completed the mods to include the define and it works perfectly.
thank you all for the suggestions.


WebFOCUS 8
Windows, All Outputs
 
Posts: 3 | Registered: February 04, 2015Reply With QuoteReport This Post
Master
posted Hide Post
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
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Reply With QuoteReport This Post
Platinum Member
posted Hide Post
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

  • No records (probably due to a WHEN filter)
  • A COMPUTE
  • A DEFMACRO that uses the computed value


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.1.0.4, Dev/App Studio: 8.1.0.4 Dev:App Studio, Dev Studio 8.1.0.4 OS:Windows 7 Output:AHTML, Excel 2007

The life of a designer is a life of fight against the ugliness.
 
Posts: 138 | Location: North Carolina | Registered: August 10, 2012Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] DEFMACRO - 2 conditions

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.