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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
Ampersand in Define
 Login/Join
 
Platinum Member
posted
I've got a define that includes an ampersand ("&"), but it is NOT a prompted value. Rather, it is part of a formula that I am passing out the result.

The define is:
 FLD1/A250='<td align=left x:num x:fmla="=SUMPRODUCT((E10:E1740=T(INDIRECT("A"&ROW())))*(F10:F1740=T(INDIRECT("B"&ROW()))))">0</td>';
 


So WebFOCUS thinks that the &ROW is a prompt.

How do I get WebFOCUS to NOT think that the "&" is a prompt?


Production - 7.6.4
Sandbox - 7.6.4
 
Posts: 241 | Location: Bethesda, MD | Registered: August 14, 2007Report This Post
Guru
posted Hide Post
Try adding the pipe | between the amper and the following letter.

HTH


jimster06
DevStu WF 7.6.11
W7
HTML, PDF, EXL2K
 
Posts: 252 | Location: USA | Registered: April 15, 2003Report This Post
Virtuoso
posted Hide Post
Do a search on escape character.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Platinum Member
posted Hide Post
One work around would be to define or -SET the ampersand as a variable and concatenate the variable in your second line.

  
-SET &R='&';

(now your DEFINEs will have to be.....)

FLD1/A250='<td align=left x:num x:fmla="=SUMPRODUCT((E10:E1740=T(INDIRECT("A"' || &R || 'ROW())))*(F10:F1740=T(INDIRECT("B"' || &R || 'ROW()))))">0</td>';



Sandeep Mamidenna


-------------------------------------------------------------------------------------------------
Blue Cross & Blue Shield of MS
WF.76-10 on (WS2003 + WebSphere) / EDA on z/OS + DB2 + MS-SQL
MRE, BID, Dev. Studio, Self-Service apps & a dash of fun !! Music
 
Posts: 218 | Location: Jackson, MS | Registered: October 31, 2006Report This Post
Platinum Member
posted Hide Post
In the example above, make sure you use the strong concatenation symbol (||) not the weak one (|), to eliminate any unnecessary spaces.


-------------------------------------------------------------------------------------------------
Blue Cross & Blue Shield of MS
WF.76-10 on (WS2003 + WebSphere) / EDA on z/OS + DB2 + MS-SQL
MRE, BID, Dev. Studio, Self-Service apps & a dash of fun !! Music
 
Posts: 218 | Location: Jackson, MS | Registered: October 31, 2006Report This Post
Platinum Member
posted Hide Post
WebFOCUS does not seem to like the "A" (the quotes).


Production - 7.6.4
Sandbox - 7.6.4
 
Posts: 241 | Location: Bethesda, MD | Registered: August 14, 2007Report This Post
Virtuoso
posted Hide Post
FLD1/A250='<td align=left x:num x:fmla="=SUMPRODUCT((E10:E1740=T(INDIRECT("A"' || &R || 'ROW())))*(F10:F1740=T(INDIRECT("B"' || &R || 'ROW()))))">0</td>';


If you go that route, you need to put quotes around &R:
FLD1/A250='<td align=left x:num x:fmla="=SUMPRODUCT((E10:E1740=T(INDIRECT("A"' || '&R' || 'ROW())))*(F10:F1740=T(INDIRECT("B"' || '&R' || 'ROW()))))">0</td>';


Otherwise DEFINE will think & is the name of a Focus field.

(in fact you don't need &R at all -- '&', quotes included, is fine by itself.)


Another tack is to code a substitute character (say, ^), and then use CTRAN in a second define to transform it to &. That will be easier to code and to desk-check.

This message has been edited. Last edited by: j.gross,


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Platinum Member
posted Hide Post
That gives me an error:

HTML ERROR in Cell Formula : =SUMPRODUCT((E10:E1740=T(INDIRECT(

if I use:

FLD1/A250='<td align=left x:num x:fmla="=SUMPRODUCT((E10:E1740=T(INDIRECT(A' | '&R' | 'ROW())))*(F10:F1740=T(INDIRECT(B' | '&R' | 'ROW()))))">0</td>';


Then the whole formula gets out to Excel, but not the quotes around the "A" and "B".

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


Production - 7.6.4
Sandbox - 7.6.4
 
Posts: 241 | Location: Bethesda, MD | Registered: August 14, 2007Report This Post
Virtuoso
posted Hide Post
The value stored in FLD1 is as below. Note my understores, indicating paired double-quotes and the content between them. Obviousy, there's a conflict between the outer double-quotes for x:fmla="..." and the inner ones around A and B (that's the basis of the error message, and the chunk of code quoted therein).

You need to change the outer ones to single quotes (coded in Focus as pairs of apostrophes), or escape the inner ones as \" (I think html respects that).

<td align=left x:num x:fmla="=SUMPRODUCT[[E10:E1740=T[INDIRECT["A"&ROW[))))*[F10:F1740=T[INDIRECT["B"&ROW[)))))">0</td>
                            ==================================== ================================== ============


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Platinum Member
posted Hide Post
Use this to expand on-hope it helps
DEFINE FILE CAR
AMPER/A1 = '&';
XX/A4 = 'H'||(' '|AMPER)||('H');
END
TABLE FILE CAR PRINT CAR XX BY COUNTRY
END

Ira
aix 533 WF 5.3.3(P), 5.3.7 (D) 7.6.1(T)


aix-533,websphere 5.1.1,apache-2.0,
wf 538(d), 537 (p),
==============
7.6.11 (t) aix 5312
websphere 6.1.19
apache 2.0
 
Posts: 195 | Registered: October 27, 2006Report This Post
Expert
posted Hide Post
Assuming the formula is correct, it seems like the first suggestion by jimster06 is correct.

This

DEFINE FILE CAR
FLD1/A250='<td align=left x:num x:fmla="=SUMPRODUCT((E10:E1740=T(INDIRECT("A"&|ROW())))*(F10:F1740=T(INDIRECT("B"&|ROW()))))">0</td>';
END

Evaluates to this:

DEFINE FILE CAR
FLD1/A250='<td align=left x:num x:fmla="=SUMPRODUCT((E10:E1740=T(INDIRECT("A"&ROW())))*(F10:F1740=T(INDIRECT("B"&ROW()))))">0</td>';
END


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
You need three sets of nested quotes:
(1) outermost, the string indicator for Focus DEFINE (single quotes)
(2) next, in HTML, delimiting the value for xfmla (single or double quotes)
(3) innermost, in the Excel formula, within the arg of INDIRECT() (double quotes)

To avoid conflicts, use single-quotes for #2 -- escaping them (within the outer single-quotes) by coding pairs of single quotes -- thus:

FLD1/A250=
'<td align=left x:num xfmla=''=SUMPRODUCT((E10:E1740=T(INDIRECT("A"&ROW())))*(F10:F1740=T(INDIRECT("B"&ROW()))))''>0</td>'
;

That will place this value in FLD1:
 <td align=left x:num xfmla='=SUMPRODUCT((E10:E1740=T(INDIRECT("A"&ROW())))*(F10:F1740=T(INDIRECT("B"&ROW()))))'>0</td>


and that should do it.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Platinum Member
posted Hide Post
The two single quotes fixed it.

My define:

 FLD2/A250='<td align=left x:num x:fmla=''=SUMPRODUCT((E10:E50000=T(INDIRECT( "A" ' | '&' | 'ROW())))*(F10:F50000=T(INDIRECT( "B" ' | '&' | 'ROW()))))''>0</td>'; 


Production - 7.6.4
Sandbox - 7.6.4
 
Posts: 241 | Location: Bethesda, MD | Registered: August 14, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders