Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Community,
I have a dimension which has a length of around 150 characters.
Instead of using the complete name in the dimension label for each bar, I want to be able to use a substring (the first substring or the last substring) in the label for Dimension in the chart visualization.
For Example, if the deptname is ADFDFDDFDDFQQ4GR44DFFDFDFEGBJNUDFDFDNIONIN/ADFDFDFI/ADFDADFEBRR7FDFD/DADFWRVDFD, i want the chart to only display (say) its last substring which is 'DADFWRVDFD' and so on for every bar in the dimension.
Is there anything we can do using aggregate function for the dimension label for the chart or something like that?
Please find the sample attached.
Regards,
-Khaled.
Use subfield(DeptName,'/',-1) to get the last substring or subfield(DeptName,'/',1) to get the first substring.
Hi PFA
just write in calculated dimension as
subfield(ur fieldname,'/',1)
it gives first part of the string,
subfield(ur fieldname,'/',-1)
for last substring
same u can change number which part u want.
Hi,
ADFDFDDFDDFQQ4GR44DFFDFDFEGBJNUDFDFDNIONIN/ADFDFDFI/ADFDADFEBRR7FDFD/DADFWRVDFD
if u want to diplay above dept NAME ,start string eg- ADFD it can be done in Presentation tab> Legend> mark on Show legend-Dept NAME & then mark on Limit Legend(Characters) as 4 then you will get the ADFD.
Use subfield(DeptName,'/',-1) to get the last substring or subfield(DeptName,'/',1) to get the first substring.
Hi,
Thank you for your response.
I cannot use this since the length of the string to extract for name is not of fixed length.
Regards,
-Khaled.
Gysbert,
I used something like:
=SubField(Level1Desc,'/',(SubStringCount(Level1Desc,'/')+1)) and it works fine where +1 is to get the index of the delimiter ('/') for the first string esp. when the substring count is varying.
Thank you for your response.
Regards,
-Khaled.
Thank you,
I noticed I could just mark only one answer as correct.
Many thanks for all your effort.
Regards,
-Khaled.