How can I execute a SELECT statement in an expression? [message #1721822] |
Sun, 31 January 2016 09:41  |
Eclipse User |
|
|
|
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 00:41  |
Eclipse User |
|
|
|
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"];
|
|
|
Powered by
FUDForum. Page generated in 0.03585 seconds