Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] CASE STATEMENT and CUSTOM VALUE

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] CASE STATEMENT and CUSTOM VALUE
 Login/Join
 
Guru
posted
IS there a way in IBI to use CASE statements as sql does.
For example:

case when Len(l.id)=6 then 'WebTours'
when Len(l.created_by)=4 then 'SchoolEntered'
else 'PhoneCalls' end channel,

And Is there a way to assign the custom values where Case is true?

This message has been edited. Last edited by: Kerry,


WebFOCUS 7.6.10
Windows
HTML
 
Posts: 294 | Registered: March 04, 2010Report This Post
Guru
posted Hide Post
Even SQL query is not working for this:

 SQL SQLMSS PREPARE SQLOUT2 FOR
select
case when Len(l.id)=6 then 'WebTours'
        when Len(l.created_by)=4 then 'SchoolEntered'
            else 'PhoneCalls' end as chanel,
    l.id lead_id,
    l.last_name,
    l.first_name,
    case when l.status = 'Invalid' then 'Invalid' else 'Valid' end lead_status,
    l.lead_source,
    date_entered-.2083 date_entered_cst,
    case when l.status = 'Invalid' then reason_dom_c else ' ' end invalid_reason,
    brand_dd_c
,t.FiscalYear 
,t.Period
,t.Week

from EXT_SUG_Leads l
left outer join EXT_SUG_Leads_Cstm  as lc on l.id = lc.id_c
  JOIN Dim_time T on T.date = convert(varchar,L.date_entered,101)

where l.deleted = '0'
and brand_dd_c not in ('TT', 'CT', 'LPA', 'CCY', 'MU')
and l.date_entered-.2083 >= '07/04/2009'
and Len(l.id) = 6


SET BYDISPLAY = OFF
TABLE FILE SQLOUT2
PRINT
chanel AS 'Channel'
lead_id as 'Lead ID'
last_name as 'Last Name'
first_name as 'First Name'
lead_status as 'Lead Status'
lead_source as 'Lead Source'
date_entered_cst as 'Date Entered Custom'
invalid_reason as 'Invalid Reason'
brand_dd_c as 'Brand'
BY Week 
BY Period 
ON TABLE SUBHEAD
"Sugar CRM Report"
ON TABLE SUBFOOT
"Prepared on <+0>&DATEMDYY <+0> "
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT &WFFMT.(<HTML,HTML>,<PDF,PDF>,<Excel 2000,EXL2K>,<Excel Formula,EXL2K FORMULA>,<HTML Active Report,AHTML>,<Active Report Flash/Flex,FLEX>,<PowerPoint,PPT>).Select type of display output.
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$

			 


WebFOCUS 7.6.10
Windows
HTML
 
Posts: 294 | Registered: March 04, 2010Report This Post
Master
posted Hide Post
Yes WebFOCUS provides functions like LENGTH, DECODE and control statement IF ... THEN ... ELSE. Are you looking for similar features?
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
Guru
posted Hide Post
quote:
and control statement

YEs I am looking for a function like this; but LENGTH is not working for me. For exmaple If want to create a defined field

FIELD123/A20 = IF LENGTH(ID) EQ 6 THEN 'ABCD' ELSE ID.

What is the sysntax? I looked at dev studio help but thats not working out.


WebFOCUS 7.6.10
Windows
HTML
 
Posts: 294 | Registered: March 04, 2010Report This Post
Virtuoso
posted Hide Post
Try function ARGLEN.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Guru
posted Hide Post
quote:
ARGLEN.

I did use it but I am able to use it in the COMPUTE however when I use it in define it doesnt work.
Can you bounce me idea where AGRLEN EQ 6 then 'ABCD'
I cant use the compute cause it wont populate the field while compute gets executed at the end of procedure.


WebFOCUS 7.6.10
Windows
HTML
 
Posts: 294 | Registered: March 04, 2010Report This Post
Virtuoso
posted Hide Post
DEFINE FILE CAR
 COUNTRY_LEN/I5 = ARGLEN(10,COUNTRY,'I5');
END

TABLE FILE CAR
 PRINT COUNTRY COUNTRY_LEN
END


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Guru
posted Hide Post
Dan you are right as always. For some reason, when I do a check with dev studio test my define it gives me an error message. But the defined field works just fine in the report. As always, thank you so much for your help.

Regards,
Arif


WebFOCUS 7.6.10
Windows
HTML
 
Posts: 294 | Registered: March 04, 2010Report This Post
Virtuoso
posted Hide Post
I'm certainly not always right! But ARGLEN has been around a long time and I was certain it would work in a DEFINE.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] CASE STATEMENT and CUSTOM VALUE

Copyright © 1996-2020 Information Builders