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] storing Totals or Values as &var

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] storing Totals or Values as &var
 Login/Join
 
Gold member
posted
Not sure about the best way to describe this, but;
End goal: find the percentage Revenue for each Market of the total revenue for the company; 100*(Market Revenue)/(Company Revenue)

I have several HOLD files going down to, and joined at the Market Grain.
I have a separate component finding Revenue at the Company level. I can't display the Market Grained Key without the revenue being broken down by market (I think this is a cube oddity). Without the Key I can't join it to the Market Grain holds.

So is there any way I can store Company Revenue in an &var? Be it a field, from Total, or in DM? other work-arounds?


Thanks!

This message has been edited. Last edited by: Nicholas Spyrison,


_____
WF 8.1.04
Win 7// Windows Server 2012 R2
SASS OLAP Cube
 
Posts: 92 | Registered: July 31, 2015Report This Post
Virtuoso
posted Hide Post
With something similar to this you can extract the company revenue
TABLE FILE CAR
SUM DEALER_COST AS 'REVENUE'
ON TABLE HOLD AS HLD FORMAT BINARY
END
-RUN
-READFILE HLD
-RUN
-TYPE REVENUE: &REVENUE

Perform on your own Revenue at the Company level file.


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
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Gold member
posted Hide Post
quote:
TABLE FILE CAR
SUM DEALER_COST AS 'REVENUE'
ON TABLE HOLD AS HLD FORMAT BINARY
END
-RUN
-READFILE HLD
-RUN
-TYPE REVENUE: &REVENUE


But then it just parameter prompts for &REVENUE
shouldn't we have to -SET &REVENUE?

maybe something like the follwoing?

-RUN
-READFILE HLD
-RUN
-SET &REVENUE = <REVENUE;
-TYPE REVENUE: &REVENUE 


or is there something I am missing?
I am using an alpha hold file.


_____
WF 8.1.04
Win 7// Windows Server 2012 R2
SASS OLAP Cube
 
Posts: 92 | Registered: July 31, 2015Report This Post
Expert
posted Hide Post
Add a -DEFAULTH for &REVENUE, this will stop the prompting


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Gold member
posted Hide Post
Wouldn't that defeat the point? I am trying to store &REVENUE dynamically, not default it to a value.


_____
WF 8.1.04
Win 7// Windows Server 2012 R2
SASS OLAP Cube
 
Posts: 92 | Registered: July 31, 2015Report This Post
Expert
posted Hide Post
My assumption is that the fex exists in MRE and when the code is executed, it is scanned for & variables.
If there is no -SET or -DEFAULT(S|H) before the variable it will be prompted.

Adding the -DEFAULTH before(Actually, probably anywhere) the -READFILE will fix this.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Gold member
posted Hide Post
I feel like my knowledge is lacking...

Is the -READFILE HLD just going to push <|var into &var then?

I'll try mocking something simpler up in CAR tomorrow. My fex is getting too busy.


_____
WF 8.1.04
Win 7// Windows Server 2012 R2
SASS OLAP Cube
 
Posts: 92 | Registered: July 31, 2015Report This Post
Expert
posted Hide Post
Wait till you have a fex that is over 13k lines...
Eeker


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
Nicholas,

A -DEFAULT(H) will provide a value for the variable if it is not -SET within your process.

A -READ, -SET or -READFILE will override any -DEFAULT that you have previous applied.

As has been mentioned a few times on the Forum recently, -DEFAULTH will be "ignored" by parameter prompting.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Gold member
posted Hide Post
Try this. You need to read in the var name.

TABLE FILE JACK1
WHERE LISTIT EQ &HOW_MANY;
WRITE CUM_TA_SHR
ON TABLE HOLD AS 'JEFFX' FORMAT ALPHA
END

-RUN
-READ JEFFX &POT.A6.
-RUN


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 74 | Registered: December 23, 2013Report This Post
Virtuoso
posted Hide Post
J.L., you method is also good, but you have to be aware of the field format.

Using READFILE all hold field become a variable, you don't mind the format and the variable has the field name as its &var name.

Both method is good. With READFILE you also don't mind about order of fields when you reference them and you can have 4 fields in the hold file but only reference the first and third one, per example. With READ it's important to READ all the &var in the same order/format as they have been hold.


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
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Gold member
posted Hide Post
quote:
Wait till you have a fex that is over 13k lines...


App studio struggles (or crashes) switching between components of a 250 line, 12 component fex with our set up. How does everyone else manage? tweaking tomcat sever allocation?


I digress...

I have the following working. Note that SET ASNAMES=ON is important here. I will relay this attempt back to my original fex.

SET ASNAMES = ON
TABLE FILE IBISAMP/CAR
SUM
     DEALER_COST AS 'REVENUE'
ON TABLE NOTOTAL
ON TABLE HOLD AS HLD FORMAT BINARY
END
-RUN
-DEFAULTH &REVENUE = 0
-READFILE HLD
-RUN
-TYPE REVENUE: &REVENUE


_____
WF 8.1.04
Win 7// Windows Server 2012 R2
SASS OLAP Cube
 
Posts: 92 | Registered: July 31, 2015Report This Post
Gold member
posted Hide Post
OK have it working as expected. Thanks everyone!


_____
WF 8.1.04
Win 7// Windows Server 2012 R2
SASS OLAP Cube
 
Posts: 92 | Registered: July 31, 2015Report This Post
Guru
posted Hide Post
I am sure Waz uses a 13k lines fex to do a complex ETL with a lot of MATCHES, JOINS, DEFINES, MODIFYs and etc.

He also should use any text editor to edit those 13k fex under approot. Am i right?


WebFOCUS 8.1.05 / APP Studio
 
Posts: 272 | Location: Brazil | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
In this case yes all done in a text editor, GUI could not handle the code. The code was in the APP path, but this fex (Actually group of fexes) produced statements and I would confidently state that is may be the most complex fex ever done. Certainly in the top 10.

[ Waits for head swelling to subside ]


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Platinum Member
posted Hide Post
Ok so

quote:
A -DEFAULT(H) will provide a value for the variable if it is not -SET within your process.

A -READ, -SET or -READFILE will override any -DEFAULT that you have previous applied.

As has been mentioned a few times on the Forum recently, -DEFAULTH will be "ignored" by parameter prompting.


Given this; if I have < -DEFAULTH &FM=' ' > then the variable &FM has some value, however, if I have < -DEFAULTH &WFFMT = 'HTML' > then my variable &WFFMT contains 'HTML'. In either case I won't be prompted for the values of these variable; is that right?

I know this is such a newbie question, but I'm getting there. slowly

Also

-READFILE RPTPERIOD tells me that the fields in RPTPERIOD can be used as variables in any order as long as they are in the same format; is that correct?

Thanks for any clarification you can offer!

Pondog


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 116 | Location: Birmingham, Al | Registered: July 23, 2015Report This Post
Virtuoso
posted Hide Post
quote:
Given this; if I have < -DEFAULTH &FM=' ' > then the variable &FM has some value, however, if I have < -DEFAULTH &WFFMT = 'HTML' > then my variable &WFFMT contains 'HTML'. In either case I won't be prompted for the values of these variable; is that right?

Correct. As long as &FM and &WFFMT don't receive any other value as input parameter from another fex or HTML page they will keep the DEFAULTH value and you won't be prompted to provide values.

quote:
Also-READFILE RPTPERIOD tells me that the fields in RPTPERIOD can be used as variables in any order as long as they are in the same format; is that correct?

Correct. But if there are 4 fields in RPTPERIOD, they don't need to be all in same format. You can have 3 alphanumeric and 1 numeric field. READFILE will assign the proper format to each as they are in the TABLE FILE.


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
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Platinum Member
posted Hide Post
Outstanding! Thanks a bunch, MartinY


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 116 | Location: Birmingham, Al | Registered: July 23, 2015Report 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] storing Totals or Values as &var

Copyright © 1996-2020 Information Builders