cancel
Showing results for 
Search instead for 
Did you mean: 

Calculation to Return a value where product begins with a certain letter

peersbrennanctb
Explorer
0 Kudos

Hi all

I have the measure "Sales" and a dimension "Prod_Code".

I want to be able to create a measure where it returns the sales value of all products that begin with "Li".

I cant get it to work does anyone know how to do this?

Thanks

peersbrennanctb
Explorer
0 Kudos

nikhil_1486

Accepted Solutions (0)

Answers (1)

Answers (1)

N1kh1l
Active Contributor

peersbrennanctb

I am not sure how you ant to display it. But you can try below. First create a calculated dimension as shown below. in My example I have taken product starting with MZ

IF(LEFT([d/"SAP_CEP_SALES_PLANNING":SAP_CEP_PRODUCT].[p/ID], 2)="MZ", "MZProduct", [d/"SAP_CEP_SALES_PLANNING":SAP_CEP_PRODUCT])

Secondly create a restricted measure on this calculated dimension as shown below

Output:

Br.

Nikhil

N1kh1l
Active Contributor

peersbrennanctb

I have created a calculated dimension to categorize all products starting with MZ in a calculated dimension as MZ products ( first part of solution). This will take care of any new products added also. You can then create restricted measure with this new calculated dimension. Please see the first part of the solution.

Br.

Nikhil