Hi everyone
I need to do something in Electronic Reporting using formulas but I need some help because I'm having a hard time doing this.
I am trying to recover a character using a specific character as a parameter ina character string.
Ok, I will try to demonstrate it.
In a a specific text field of D365FO I have the information "654321-0".
In the model mapping I only needs to bring the characters that are after the character "-".
Is it possible to do that in using formula in Electronic Reporting?
Thanks to advance
Sorry. That's the correctly formula:
IF(CONTAINS(Doc_fiscal.'find()'.ThirdPartyCCMNum,"-"), RIGHT(Doc_fiscal.'find()'.ThirdPartyCCMNum, 1), "")
Hi, Alireza.
Thank you so much man. You helped me a lot. I needed to change a little bit your formula but you was right. It's worked. Below is the formula that I used in my ER model mapping.
IF(CONTAINS(Doc_fiscal.'find()'.ThirdPartyCCMNum,"-"), RIGHT(Doc_fiscal.'find()'.ThirdPartyCCMNum, 1
One more time, thank you so much, Alireza.
Hi Eric,
Thanks for the clarification.
Then you can use combination of 1-IF 2-Contain 3-RIGHT functions as follows:
IF(
CONTAINS(parameter, "-"),
RIGHT(parameter,1),
"")
Or 1-IF 2-Contain 3-MID functions as follows
IF(CONTAINS(parameter, "-"),
MID(parameter,8,5),
"")
It will check and if it finds "-" on the Governmental number it will use RIGHT or MID functions, if not it will use "" (Blank).
I hope it helps you.
Hi Alireza.
Sure.
Example:
I have a text field in the vendor account. in this field I need to fill a specific governmental code of the vendor. For some cases this number has a check digit separated by a hyfen. In some cases this number don't has this check digit. In ER I am building a report that retrieves this number and its possible check digit. If the governmental number provided by vendor has a check digit I need to fill it in a specific field of the report. If don't this field on the report needs to leaves in blank.
Example with check digit.
Governmental number: 654321-0
Field on ER: "0"
Example without check digit.
Governmental number: 6543210
Field on ER: ""
Hi Eric,
Can you elaborate with some examples especially what should be upcoming result in ER?
Hello, Alireza.
Thanks for your reply. I need to apologize with you to. As I said to Judy above I didn't explain my scenario correctly.
The information on this field is not standardized. This is a governmental data and depends of the vendor location. Depending of the city where it is located this number can change of the format. In some cases this number will have a check digit like the format that I passed before (654321-0). In other cases this number wont have this check digit (654321).
So, in ER, in a specific field of the reporting I need to fill only the check digit if it exists. If don't this field needs to be leave in blank.
What I need is a way that attends the both cases with and without the check digit.
That is the reason that I would like to use the character "-" as a parameter. Because if the number filled on the field has the check digit it must have the character "-". Otherwise it wont have this character.
Thanks for your help
Hi Judy.
Thanks for your answer.
I need to apologize because I think that I didn't explain the whole scenario.
The information on this field is not standardized. This is a governmental data and depends of the vendor location. Depending of the city where it is located this number can change of the format. In some cases this number will have a check digit like the format that I passed before (654321-0). In other cases this number wont have this check digit (654321).
So, in ER, in a specific field of the reporting I need to fill only the check digit if it exists. If don't this field needs to be leave in blank.
What I need is a way that attends the both cases with and without the check digit. That is the reason that I would like to use the character "-" as a parameter. Because if the number filled on the field has the check digit it must have the character "-". Otherwise it wont have this character.
I hope I could to explain better now.
Hi Eric,
It is possible.
If your information is fixed with the provided format (i.e. 654321-0). You can try with Right formula - RIGHT(parameter,1). Then the result will be " 0 " .
Or if the "-" as 7 character in your field, you can use MID formula. MID(parameter,8,5)
Example: 654321-912
Result: 912
Hi Eric_Santos,
Please refer to the RIGHT ER function which returns a String value that presents the specified number of characters from the end of the specified string:
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,219 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156