Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » How can I execute a SELECT statement in an expression?
How can I execute a SELECT statement in an expression? [message #1721822] Sun, 31 January 2016 14:41 Go to next message
Michael Reiter is currently offline Michael ReiterFriend
Messages: 6
Registered: June 2015
Junior Member
Greetings,

I have followed request:
I have a DB table with three columns:
company_unit, topic, amount

In BIRT, I need a "computed column" with this idea:

if (BirtStr.search("*reserved*",row["topic"],1) > -1)
{
row["amount"] - (SELECT sum([amount])
FROM db.pmo
WHERE company_unit=row["company_unit"]
}
else
{
row["amount"];
}

or in other words:
How can I execute a SELECT statement in an expression?

Thank you!
Michael




Re: How can I execute a SELECT statement in an expression? [message #1722582 is a reply to message #1721822] Sat, 06 February 2016 05:41 Go to previous message
Stefan Seitz is currently offline Stefan SeitzFriend
Messages: 14
Registered: February 2015
Junior Member
Are you trying to calculate the following:
SUM amount
Where topic <> "*reserved*"

If so, maybe you could use the aggregation function to do this:
* In the table (or graph, ...) where you use the data, open "Binding" window of the Property Editor.
* Add Aggregation
* Set Function: SUM
* Expression:
if (row["topic"] == "*reversed*")
   0;
else
   row["amount"];

Previous Topic:Designing more flexible Layout
Next Topic:Can not load the report query
Goto Forum:
  


Current Time: Tue Apr 23 10:20:14 GMT 2024

Powered by FUDForum. Page generated in 0.02680 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top