cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

How to Filter Product Codes Using Scripting in SAP Analytics Cloud (SAC)?

10-25-2024 10:52 AM
RajuRam Active Participant
689 views 2 comments
0 Likes
SAP Managed Tags
Labels
SAP Analyitics Cloud
Subscribe

Hi Everyone,

I have product codes as dimensions in SAP Analytics Cloud (SAC). I want to filter these codes to show only those where the 13th digit is ā€œCā€ using scripting.

Can anyone help me with how to achieve this in SAC?

Thanks in advance!

0 Likes

Accepted Solutions (0)

Answers (1)

Answers (1)

N1kh1l
Active Contributor
0 Likes

@RajuRam 

You have not mentioned where you want to show these filtered product codes. If you want to display them in stories, you could create a calculated dimension and use that to filter the list. If this filtering requirement is something which you will do quite often, its advisable you add an attribute to your product dimension and flag it so that you have a universal filter for all stories and calculation.

IF(SUBSTRING([d/"MODEL":PRODUCT].[p/ID],13 ,1)="C" ,"Contains C" ,"NA" )

Also you have to ensure all product members length are more than 13. Else try to check the length first in the formula. Also the position might be 12 or 13 based on index starting at 0 or 1.

Hope this helps !

Nikhil

RajuRam
Active Participant
0 Likes
Dear Mr. Nikhil, I could not find the substring function in my calculation editor. I presume this is because my data is from SAP BW live data. Could you please confirm whether text functions will work on SAP BW live data? If not, I kindly request you to suggest an alternative approach. Thank you.