Is there a way in Webfocus/Infoassist to use CASE statements as sql does.
case WHEN TIMESTAMPDIFF(SQL_TSI_DAY, CAST("LOB Dimension".LOB_RCVD_001 AS DATE),CAST (CURRENT_DATE AS DATE) ) BETWEEN 6 AND 10 then "Work Fact".Count else 0 end
Here When i Say LOB_RCVD_001 it is Application Received date.
Wanted to know how to have this Query set in Infoassist to get the results with the count for the days given aboveThis message has been edited. Last edited by: FP Mod Chuck,
Windows, Active Report
My SQL is rusty. Could you explain what you're trying to accomplish? From what I can tell, this is just an IF THEN ELSE in a DEFINE or a COMPUTE but maybe there's more to it than that.
WebFOCUS 8206, Unix, Windows
Use something such as (in a DEFINE or COMPUTE):
DateDiff /I3 = HDIFF(CURRENT_DATE, LOB_RCVD_001, 'day-of-year', 'I3');
TestDiff /I5 = IF DateDiff GE 6 and DateDiff LE 10 THEN Count ELSE 0;
Look into manual/help for how to use HDIFF and its component format/usage.
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
A CASE command that is encountered in the sequential flow of a procedure is not executed.
You assign a unique name to each function using the CASE command.
Syntax: How to Use the CASE Command
The syntax for the CASE command is:
CASE functionname [TAKES p1/t1[,..., pn/tn]] [RETURNS result/t] [;]
Source: F1/Help from within App Studio.
I think you will find that CASE is in Maintain.
You should be able to issue ANSI SQL with a case command against any data source.
SQL select country case when country = 'ENGLAND' then 'UK' when country in ('W GERMANY','ITALY','FRANCE') then 'EUROPE' else 'Other' END from car ; END
Really, Maintain Only??? OK, if so, I stand corrected.
Well, in relation to 8.1.04, haven't checked 8.2 documentation
"CASE Statements": Sounds like it should be a NFR...
How is CASE different than DECODE? I have numerous requests where I have a WHERE on a DECODE value in a DEFINE and when I look at the SQL generated, the DECODE is converted to a SQL CASE statement.
In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
SQL CASE supports returning the results of a formula.
As mentioned by someone before, I think with IF THEN ELSE IF THEN ELSE IF .... you can do what CASE does in SQL. Actually if you look at the generated SQL you will find that IF THEN ELSE in a DEFINE or COMPUTE will be translated into a CASE statement.
WebFocus 8206M, iWay DataMigrator, Windows, DB2 Windows V10.5, MS SQL Server, Azure SQL, Hyperstage, ReportCaster
|Powered by Social Strata|