Question


Kelly Services Malaysia Sdn. Bhd.
MY
Last activity: 26 Jul 2018 1:30 EDT
Filtering a report based on a substring of my own email address
Greetings
I have a simple report definition to retrieve the list of operator IDs. The only filter I have to apply is to show those records that have the same email address domain as my ID's.
Eg. the records are
1. Proprietary information hidden
2. Proprietary information hidden
3. Proprietary information hidden
My email address is Proprietary information hidden
So only record 1 and 3 should show. How do I achieve this? I tried using the right trim/sub string calculation builder in the "Value" column but am not clear how it works
Thanks
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!


EPAM Systems, Inc.
ES
Hi @voonkeongl
Thanks for posting on PSC.
I was able to get the desired result in the report definition.
You could implement it in many ways, namely:-
1. Use domain address to compare the email id, using "Contains" or "Ends with" in Relationship drop-down of the filter condition as below.
Or Contains.
2. Using functions, You need to use multiple functions for that.
Hi @voonkeongl
Thanks for posting on PSC.
I was able to get the desired result in the report definition.
You could implement it in many ways, namely:-
1. Use domain address to compare the email id, using "Contains" or "Ends with" in Relationship drop-down of the filter condition as below.
Or Contains.
2. Using functions, You need to use multiple functions for that.
Our aim is to get domain address which would be the substring of the email id. For ex- Proprietary information hidden, "@abc.com".
Let's break,
1. Get the first position of "@" occurrence by using function "The first character position in [Text value in which [a given substring] appears". You can find this function by using "Find" keyword in the "Select a function" drop-down.
2. Configure the above function in the "Sub string" function as below,
I have given "7" as input parameter, you can customise it with how many characters you want to compare after "@".
Now you will get the substring, "@xxx.com" using the above steps for the email id field.
Use it in your filter condition to compare with static "@abc.com" value or a property having that value.
3. There is a OOTB function, "whatComesAfterFirst". You can create "Function Alias" for this and use it in the report definition directly. This function is readily available in the activity, though.
Hope it answers your query, kindly acknowledge by marking this post as answered for larger Pega audience and tracking purposes.
Regards,
Asif
-
Jeeva Thambi


Kelly Services Malaysia Sdn. Bhd.
MY
Hi Asif, I tried the 2nd method but when I tried to input "Position of [@] in [.pyEmailAddress]" in the starting at position field, it's showing an error. Please advise, thanks


Kelly Services Malaysia Sdn. Bhd.
MY
Please ignore my earlier comment, I didn't realize I need to click on the "fx" for the sub string function to enter the position, instead of copy pasting the syntax.
Still working on it


EPAM Systems, Inc.
ES
Are you able to get the desired result with this approach?


Kelly Services Malaysia Sdn. Bhd.
MY
I would like to explore more on option 3 as follow
3. There is a OOTB function, "whatComesAfterFirst". You can create "Function Alias" for this and use it in the report definition directly. This function is readily available in the activity, though.
Can you elaborate more on that? I tried creating a function alias but it's not registering because it's not appearing in the report definition. Even after I defined it under Embed-UserFunction as mentioned at https://collaborate.pega.com/question/function-alias-not-appearing-report-definition it's throwing a lot of errors.


EPAM Systems, Inc.
ES
Have you created Function Alias correctly?


Pegasystems Inc.
IN
Hi @Asif Hasan,
Can you please explain me about 3rd approach i.e. function alias.
Thanks in advance,
Vinay Reddy :)
-
Sri Lakshmi Nilagiri Armin Schmid Sagar Sinhar


EPAM Systems, Inc.
ES
Function Alias:- https://community.pega.com/sites/default/files/help_v722/procomhelpmain.htm#designer%20studio/expressionbuilder/ref_functions_methods.htm


Pegasystems Inc.
IN
Hi,
Thanks for your response,I created function alias for whatcomesafterfirst function(OOTB),so how to use it in Report Definition.
Regards,
Vinay Reddy :)


CollabPartnerz
IN
This can be achieved through function alias or contains function in filter condition of RD.


Kelly Services Malaysia Sdn. Bhd.
MY
Why does Pega make a simple function so complicated? Why can't we make a direct call to the function alias directly in the report definition? This is such a simple problem to solve if I were coding it in .NET
Can someone please help? I looked at the Pega Help link provided but it doesn't really help because there's no actual example given.
:(


Kelly Services Malaysia Sdn. Bhd.
MY
Can someone please post an example of how to call the "whatcomesafterfirst" function in the report definition? Please show the syntax as well
Please. I really need help.
Please
Thanks


Pegasystems Inc.
IN
Hi,
Function Alias will only appear in Report Definition if they are defined on the class Embed-UserFunction. They are SQL snippets which can leverage the SQL functions in the database for filtering or formatting.
Regards,
Vinay Reddy


Pegasystems Inc.
IN
Hi,
Refer below link here clearly they have given.
https://collaborate.pega.com/question/function-alias-not-appearing-report-definition
Regards,
Vinay Reddy