Query doesn't recognize existing ALIAS in query dialog
Posted on April 26, 2017 at 1:55am
Hi all,
I receive the following error: column "Code" does not exists.
(SELECT value FROM table WHERE id = $P{order_id}) as Code,
sum( case when ( Code ='ME') then Weight/1000*5 else 0 end) ME,
It seems that the query doesn't recognize the subquery.
Has anyone an idea what the cause is of this error?
Thanks in advance for any help / insights.
Joined: Feb 9 2017 - 4:57am
Last seen: 5 years 7 months ago
Posted on April 26, 2017 at 3:04pm
Jaspersoft Studio expression editor sometimes return an error message even when it's OK. Just ignore the message and save the expression and execute. Most of the time, this would work if your expression is actually valid.
Joined: Apr 24 2010 - 4:31pm
Last seen: 3 years 9 months ago
Posted on April 28, 2017 at 6:44am
Unfortunately it doesn't generate the query which holds the 'Code'.
Because of the error the field 'ME' isn't available in the report.
sum( case when ( Code ='ME') then Weight/1000*5 else 0 end) ME
Any idea's?
Thanks.
Joined: Feb 9 2017 - 4:57am
Last seen: 5 years 7 months ago
Posted on May 1, 2017 at 7:05am
It doesn't recognise the alias 'CODE'.
However, the alias CODE does exists and can be used in the report.
But not in the query.
Is there a fix for this? Or an other way to achieve it?
Thanks for any help.
Joined: Feb 9 2017 - 4:57am
Last seen: 5 years 7 months ago