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     [CLOSED] DB_EXPR FIRST_VALUE PARTITION

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] DB_EXPR FIRST_VALUE PARTITION
 Login/Join
 
Platinum Member
posted
Hi,

can someone help me to build:
DB_EXPR(
FIRST_VALUE("ARS_REPORTING.KENNZAHLEN_BESTAND.WERT_EURO") IGNORE NULLS
OVER (
PARTITION BY "ARS_REPORTING.ASSET.ASSETID",
"ARS_REPORTING.BESTAND.ASSETID"
ORDER BY "ARS_REPORTING.BESTAND.DATUM" ASC
)
)

It's just not working.
When I create a define in infoassist, it gives me syyntax error,

in testeditor with -SET &ECHO=ALL it gives me
FOC005, and FOC757.

Thanks

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 177 | Registered: October 17, 2017Report This Post
Platinum Member
posted Hide Post
Or with CAR:
DB_EXPR(FIRST_VALUE("HEIGHT") OVER (PARTITION BY "COUNTRY", "MODEL"))
doesn't work eather


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 177 | Registered: October 17, 2017Report This Post
Virtuoso
posted Hide Post
What's the output of the SQL Expression you're trying to use? The doc seems to only show examples of SELECT and below are the requirements for the DB_EXPR function:

The expression must return a single value.
Any request that includes one or more DB_EXPR functions must be for a synonym that has a relational SUFFIX.
Field references in the native SQL expression must be within the current synonym context.

You should probably check with IB Tech Support to find out if the SQL you're using is supported in this function.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Virtuoso
posted Hide Post
Jenni

Just to add to Babak's post the CAR file is a focus database and that is why your example did not work


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
 
Posts: 2127 | Location: Customer Support | Registered: April 12, 2005Report This Post
Platinum Member
posted Hide Post
Hi,

@FP Mod Chuck: I know I can't build it with that foc table, but it's just an Illustration and not my Intention to use the db_expr function in the car file case, but that's at least a datafile we both can use...

@BabakNYC: It's not my development, I just needed to "fix" the prblem with the Syntax, but I have no idea whyI get the Syntax fault..
The Expression will return a single value. DB_expr is only used once.

How can I check, wheather my SQL is supported??


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 177 | Registered: October 17, 2017Report This Post
Virtuoso
posted Hide Post
The expression FIRST_VALUE("HEIGHT") OVER (PARTITION BY "COUNTRY", "MODEL") will return multiple values when there are multiple rows in the PARTITION. It will return the same value for all those rows.

Perhaps it works if you also group BY those partition fields, because then you force the results back to one row per.

I don't think WebFOCUS supports SQL Window functions natively yet, so if that doesn't work you'll probably have to revert to native SQL.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Platinum Member
posted Hide Post
@Wep5622: But actually DB_EXPR should Support native SQL, that's how it is discribed in the documentation.

Just want to get some examples where "select" Statements are in..

Thanks


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 177 | Registered: October 17, 2017Report 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     [CLOSED] DB_EXPR FIRST_VALUE PARTITION

Copyright © 1996-2020 Information Builders