Question
PKUtech Co., Ltd
JP
Last activity: 24 Apr 2020 16:22 EDT
Filter in Report definition
Hi, all
I hope you are well.
I am required to create report definition which has several filters.
Like the following attachment, operator has some divisions such as OperatorID.Division(1).DivAbbr, OperatorID.Division(2).DivAbbr, OperatorID.Division(3).DivAbbr.....
the number of division is different depending on an operator, some people has 3 division, but others 5 or 8...
I wonder if any way of filtering by list is ... If list is used as filter, i do not need to fix the index like (1), (2), (3)...
May I have any advice? I really look forward to your advice.
***Edited by Moderator: Pallavi to update platform capability tags***
-
Likes (1)
Sandhyasree Mulakaluru -
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Updated: 14 Jun 2021 7:38 EDT
Pegasystems Inc.
IN
One option would be creating a declare index for the "Division" pagelist and joining it with the current report.
PKUtech Co., Ltd
JP
Hi, kanap2
Do you know where sample is about a declare index and joining it?
I have no experience about it, so please let me know if you know any material or reference sample...
Updated: 14 Jun 2021 7:38 EDT
Pegasystems Inc.
IN
From the App Explorer, navigate to the property(DivAbbr) which is inside pagelist(Division) and right-click on the property and click on Optimise for Reporting. Once you complete the optimization wizard for this, declare index rule will be created.
For joining this declare index with Report, you can find the OOTB reports, forpyMyCasesReport, pzFollowedCasesByUser for the sample.
IN
Hi Yuki,
Convert List into string of comma separated list and pass parameter to report definition.
Hope this helps.
PKUtech Co., Ltd
JP
Hi, Pooja
In this case, I need to input "OperatorID.Division(1).DivAbbr,OperatorID.Division(2).DivAbbr..." in value..
and the index is variable...
do you know how to create index list in value?
Pegasystems Inc.
IN
You can try calling the Report definition in an activity (using Call Rule-Obj-Report-Definition.pxRetrieveReportData) and set a parameter such that it contains a comma-separated list of all the DivAbbr(Loop through the pagelist ad concatenate the DivAbbr values) and pass this parameter to activity(Check pass current parameter page).
PKUtech Co., Ltd
JP
I an required to create report definition for portal... Activity is necessary?
Pegasystems Inc.
IN
If Activity is not needed then you can use declare trigger(to check if division divabbr is added/delete , trigger->save) then in the activity Loop through the pagelist and concatenate the DivAbbr values to one property and use the same property in the report
Pegasystems Inc.
US
There are actually a couple of ways to do this for an indeterminate length list of filter values. You can put the comma separated values in a string (escaped appropriately) or you can put them in a value list. Either of these will result in a filter clause that is equivalent to the SQL:
WHERE <col> IN (<val1>, <val2>, <val3>, ..., <valN>)
From the help page in the Dev Studio documentation: