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]- Sort through date fields using IF...THEN...ELSE
Go
New
Search
Notify
Tools
Reply
  
[SOLVED]- Sort through date fields using IF...THEN...ELSE
 Login/Join
 
Member
posted
My task was to populate one date field out of possible four fields that has a date and use the first one that has a date. I have to proceed through the 4 date fields in a certain order until i retrieve the first one that has data. If no fields are populated, then the report should generate/display n/a.

This message has been edited. Last edited by: Kort Thompson,
 
Posts: 5 | Registered: March 18, 2019Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Basic If THEN ELSE in a DEFINE

But to know if the value is there or not you're the one who knows : you need to test the "missing" value assigned to the date field when it is not populated. Is it a Null (MISSING), a specific date (1900-01-01) or something else...


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: 2119 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport This Post
Member
posted Hide Post
Thank you for your time. Can you give me an example of the if then else?
 
Posts: 5 | Registered: March 18, 2019Reply With QuoteReport This Post
Virtuoso
posted Hide Post
You've never done programming before isn't it ?

Assuming that your date fields are in YYMD format and since you want to have N/A displayed when the date is missing, must convert the date field into a text format where N/A can be displayed.
DEFINE FILE abc
NFLD /A10 = IF FLD1 NE 'MyMissingValue' THEN FPRINT(FLD1, 'YYMD', 'A10V')
       ELSE IF FLD2 NE 'MyMissingValue' THEN FPRINT(FLD2, 'YYMD', 'A10V')
       ELSE IF FLD3 NE 'MyMissingValue' THEN FPRINT(FLD3, 'YYMD', 'A10V')
       ELSE    'N/A';
END
TABLE FILE abc
PRINT …
BY NFLD
END
-RUN


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: 2119 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport This Post
Member
posted Hide Post
Thank you, just started learning in March
 
Posts: 5 | Registered: March 18, 2019Reply With QuoteReport This Post
Guru
posted Hide Post
quote:
using one of the following: TCDHTDT, TCDMMDT, TCDBHDT, OR TCDLADT.


I am unfamiliar with those. Can you explain?


Hallway
WF(Prod):8202M
WF(Test):8202M
OS/Platform:Win 10
Outputs:All
 
Posts: 412 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Reply With QuoteReport This Post
Expert
posted Hide Post
Hi Kort,

When you have found or have been provided with a solution, just edit your first post and add [SOLVED] to the begining of the post heading. Leave the original text as is so that others searching for similar questions may be able to find your post and what the solution might have been.

Also, do not change any of your original message text, unless you want to add a note to say that it's solved.

I know that many different Forums have different methods but this is what this one does Smiler


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5585 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Kort,

You must NOT replace the post title by [SOLVED] but ADD the key word in the subject.
Also as stated by Tony, do not remove your first post content, otherwise I would we know to what question the answers are for ?


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: 2119 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport This Post
Member
posted Hide Post
Got it...i replaced the original post and the subject line. Thanks again for the assistance.
 
Posts: 5 | Registered: March 18, 2019Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED]- Sort through date fields using IF...THEN...ELSE

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