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.
Anybody having any clue on how to decode some values and not others.
Suppose in master file CAR, i only want to decode 'JAGUAR' VALUES TO 'HONDA' AND want to keep other values as same as in master file, wats the syntax ??
Below syntax not working. Plz note : CAR is Hold file name as well as field name.
DEFINE FILE CAR INDIACAR/A20=DECODE CAR( 'JAGUAR' 'HONDA' ELSE CAR ); END
Lets not forget what the decode function is really for. To take some kind of code/value and translate it into an easy to understand meaningful description. If you only want to decode certain code then you have to use some kind of if then else logic.
In WebFOCUS with DECODE the ELSE value can not be a field name, it must be a literal. That can be confusing since, for instance, Oracle has a Decode function where the ELSE value can be a field name. Essentially you have to do it like GamP did it.
DEFINE FILE CAR INDIACAR/A20=DECODE CAR( 'JAGUAR' 'HONDA' ELSE CAR ); END
The DECODE function is putting the character string 'CAR' into the field INDIACAR. so the way to use decode would be something like: INDIACAR/A20=DECODE CAR('JAGUAR' 'ALL MINE' ELSE ' '); or INDIACAR/A20=DECODE CAR (filename ELSE ' '); then INDIACAR/A20=IF INDIACAR IS ' ' THEN CAR ELSE INDIACAR; in this case the word CAR references a field, not a character string. remembering that with DEFINEs, the last referenced define is the value pulled in a TABLE request, which is one of those blessedly *gifted* features of wf we take for granted and can't live without.
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
In sql the Decode function is used often to flip the axis of data. (denormalize data) I'm sure there's a better term, but I don't know what it is.
Such as, if you have data of Product Line Sales $
To get the Sum of Sales for a Product Line you would have to do a Select ProductLine, Sum(sales) from table group by ProductLine
but, what if you wanted to group those productlines together? As in you wanted to combine something like Soap and Shampoo
Select sum(Case when productline in ('Soap','Shampoo') then Sales else 0 end) as "ShowerSupplies', Sum(case when productline NOT in ('Soap','Shampoo') then Sales else 0 end) as "Everything_But_ShowerSupplies' from sometable
Comes in handy more than one might think. Thought I'd bring it up.
Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.