Question

2
Replies
65
Views
Close popover
Russell Welton (RussellW6092)
Vodafone UK Ltd

Vodafone UK Ltd
GB
RussellW6092 Member since 2018 4 posts
Vodafone UK Ltd
Posted: November 15, 2019
Last activity: November 15, 2019
Closed
Solved

Paramerising Function-Alias Causing Error

Hey,

I am trying to build a function-alias rule to take in paramertised inputs into an interval calculation to improve run time over the current Difference In Day/Min/Hour Function currently provided.

<%
String parameter2 = tools.getStepPage().getString(".pyParameters(2).pyParametersParamValue").replaceAll("\"","").replaceAll("'","");
%>
<p:choose>
<p:when java="<%= parameter2.equals("days") %>">
<p:choose>
now()::date - interval '{1} days'
</p:choose>
</p:when>
<p:otherwise>
ERROR : Unknown Interval Type
</p:otherwise>
</p:choose>

On Execution I am getting the error:

Error:
An error occured on executing the query for the report definition - There was a problem getting a list: code: 0 SQLState: 22023 Message: The column index is out of range: 1, number of columns: 0. DatabaseException caused by prior exception: org.postgresql.util.PSQLException: The column index is out of range: 1, number of columns: 0. | SQL Code: 0 | SQL State: 22023

However hardcoding the value allows it to work sucessfully.

Any ideas how I can pass a parameter into a '' encapsulated string?

I have attached screenshots for reference.

Many Thanks In Advance

Pega Platform Reporting
Moderation Team has archived post,
Close popover This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.