Question
Nielsen
US
Last activity: 4 Sep 2017 6:26 EDT
Distinct values from a List
How can I get distinct records from a List (Code-Pega-List) which is a list of Strings.
Also is there a way to get distinct records when getting data from DB using say Obj-Browse.
Thanks,
Smitha R
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Virtusa
IN
Hi Smitha,
Please follow below steps:
1. take one more pagelist to copy distinct records
2. Please use "IsInPageList" utility to check Code-Pega-List record exist in new pagelist. It returns boolean value based on this copy the values to new pagelist.
please let me know if any clarification is required.
Regards,
Venkateswarlu.
-
Vignesh Amarnathan
Pegasystems Inc.
IN
There are OOTB functions to handle exact requirements
CheckDuplicatesInPageList
RemoveDuplicatesInPageList
Please let us know if this helps :)
Nielsen
US
Hi , Is this the method and the syntax :
@Utilities.removeDuplicatesFromList(MyOrginalList ,"Email","ORG-Member-DETAILS")
where MyOrginalList - Code-Pega-List
Email is a field in it (was set using MyOrginalList.pxResults(<CURRENT>).Email )
ORG-Member-DETAILS is the Class Type to which each entry in MyOrginalList belongs.
The two lists have the same data after this is applied . Can you help me with it?
Thanks,
Smitha R
Wells Fargo
IN
Hi Smitha, Is this worked ? Please help me using this ?
Pegasystems Inc.
IN
Hi Smiths,
Could you try below
Rule-Utility-Function-pega_rules_utilities.removeDuplicatesFromList(<PageListName> , <KeyProperty>, <ClassOfEntriesInThePageList>);
Call it from a Java step in a activity
Thanks,
Ujjwal
Ernst & Young LLP
IN
How to selectively get the count from a valuegroup having only nonzero entries without using DT or activtity. Need to do it in a declare expression,
eg-
A(a) - aaa
A(b) - bbb
A(c) - 0
A(d)- ddd
A(e)- 0
Commonwealth Bank
IN
Use Function
@Utilities.pyRemoveDuplicatesFromPagelist(ListPage,PageListName,DuplicateCheckProperties)
In Function Just give @( Pega-RULES:Utilities).pyRemoveDuplicatesFromPagelist(DuplicateEntry,".pxResults","DuplicateID")
for example
Return Value --- Just Leave blank
DuplicateEntry.pxResults is your PageList and in that PageList DuplicateID is the property u want to compare
Have attached step in the screebshot
ING
BE
Using functions pyRemoveDuplicatesFromPagelist or pzRemoveDuplicatesFromListPage duplicate entries will be removed from your pagelist but it's unfortunate to see pxResultCount not being updated with the new results. This property should get updated with the count of new results after duplicates are removed, however it is still displaying the old picture.
Is this a bug in the above two functions?
I also tried removeDuplicatesFromList function, although pxResultCount is getting updated with the new picture but somehow it didnt work for me - I had 18 records with the same keyProp value but the function removed 14 entries.
Thanks,
Ozkan M.
-
hanumantha kosuri Pradip Kavade
Pegasystems Inc.
IN
ING
BE
URL of the new post...
https://collaborate.pega.com/question/pega-oot-functions-remove-duplicate-entries-pagelist
Pegasystems Inc.
US
Hello,
I tried a sample use case to remove the duplicates from the Page List using UserName field as shown in attachment.
Hope it might help you guys to achieve your requirement.
Regards
Mahesh