Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Im able to identify the dimensions via the expression but unable to display the text only i wish to see.
Below is the result which is correct however i only wish to display the String text containing and starting with PLRF
Expression is
only({<CustItemRef={"*^PLRF*"}>}CustItemRef)
Need to have the CustItemRef only show PLRF01012111
Thank you i hope the is a good explanation.
I think it should work in this way by this case. Depending on your data you may need multiple replace() statements and/or also some further string-functions like trim(), keepchar() and similar.
Especially if there are really n different types and/or it's used several times and/or there are further requirements with additionally TOTAL or aggr() - it would be better to make these things within the script and not in the UI.
- Marcus
Try
Wildmatch(CustItemRef, '*PLRF*')
Thank you, this will just confirm if PLRF is in text string.
Im able to get the result but just want to display the result below as PLRF01012111 not the -H61761
Thanks
Chart: Straight table
Dimensions: ItemCode , CustItemRef
Exp: Wildmatch(CustItemRef, '*PLRF*')
Hide the above expression (Presentation--> hide column)
Unfortunately still giving the full CustItemRef i only want the PLRF01012111
Thanks
You may try it with: subfield(YourExpression, ' ', 1)
- Marcus
Yes this absolutely trims it and helps, still struggling to trim it and pull it out of a long text string.
For example
Here is PLRF01012111-jjj in a string
I just want the PLRF01012111
But massive thanks
The more variance are in your data the more efforts are needed to consider them all. To extend it to this case you may add a replace, like:
subfield(replace(YourExpression, '-', ' '), ' ', 1)
- Marcus
Very close just now, thank you 🙂
subfield(replace(only({<CustItemRef={"*^PLRF*"}>}CustItemRef), '-', ' '), ' ', 1)
Just need the - H61760 dropped
I think it should work in this way by this case. Depending on your data you may need multiple replace() statements and/or also some further string-functions like trim(), keepchar() and similar.
Especially if there are really n different types and/or it's used several times and/or there are further requirements with additionally TOTAL or aggr() - it would be better to make these things within the script and not in the UI.
- Marcus