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.
I have to convert an existing report into Webfocus. The report criteria is a sample mix of random cities. I need to pull atleast one record for each cities but this should change everytime they run the report. In SQl there is a function called 'SAMPLE' which does this. I am looking for webfocus equivalent.
Unfortunately there is no function similar to SAMPLE in WebFOCUS that I know, so we need to work around it.
This is the sample of SQL "SAMPLE" and it's output:
SELECT TOP 10 LastName FROM DimCustomer TABLESAMPLE(1 PERCENT)
First run Second Run Third Run
LastName LastName LastName Ortega Yang Romero Campbell Huang Bryant Hughes Torres Mehta Alvarez Zhu Malhotra Vazquez Johnson Diaz Chapman Ruiz Lu Anand Alvarez Raji Vazquez Mehta Moreno Martinez Verhoff Goel Chande Carlson Howard
------------------------------------------------------------------ This is one way to do in WebFOCUS:
TABLE FILE DIMCUSTOMER SUM COMPUTE random/D20.6 = RDNORM('D20.6'); NOPRINT BY TOTAL HIGHEST 10 random NOPRINT BY LASTNAME END
First run Second Run Third Run
LASTNAME LASTNAME LASTNAME Gonzalez Rizaldy Ramirez Ptaszynski Weadock Roessler Hee Anderson Jones Saraiva Weber Raman He Chander Kelly Gray Sanders Narayanan Palit Rodriguez Skjønaa Zheng Hill Thomas Ruggiero Madan Song Diaz Ferrier Jordan
If Sharam's solution isn't giving you what you want then you can simply do a SQL pass thru to get your sample and then use WebFOCUS to format it
SQL SQLMSS PREPARE SQLOUT FOR
SELECT TOP 10 LastName FROM DimCustomer TABLESAMPLE(1 PERCENT)
END
TABLE FILE SQLOUT
PRINT LastName AS 'Last Name'
ON TABLE PCHOLD FORMAT HTML
END
You will need to change SQLMSS in the first line to match the data adapter you are using if it isn't SQL Server
Hope this helps
Stu
WebFOCUS 8.2.03 (8.2.06 in testing)
Posts: 253 | Location: Melbourne, Australia | Registered: February 07, 2007
Shru, If you do not use SQL passthru, I suggest you use the RDUNIF function (which gives a uniform distribution) and not the RDNORM function (which gives a normal distribution meaning more numbers around the average).
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006