cancel
Showing results for 
Search instead for 
Did you mean: 

SAP analytics cloud-Stories-If else with Like

0 Kudos
4,871

Hi Team

I have limited access in my organisation like I can work only on stories . We dont have data model access to create or edit.

I need to create a new column on a story/ table where I was showing data :

if company_name like "*ABC*" then "new_grp_name" else company_name

Could you please help on this.

Thanks

Neha

Accepted Solutions (1)

Accepted Solutions (1)

former_member207052
Active Contributor
0 Kudos

Hello,

Look under dimensions instead of measure. you have to create a calculated dimension.

You could look into the learning materials for further details on getting started with SAC: https://www.sapanalytics.cloud/guided_playlists/

Answers (3)

Answers (3)

former_member207052
Active Contributor

Hello,

Create a Calculated dimension with the below formula:

You have to specify whether you want to compare the ID or the Description of the dimension. You could use ctrl + Space to get help in the formula window.

IF(LIKE([d/"BestRunJuice_SampleModel":Sales_Manager__5w3m5d06b5].[p/Description],
        ".*W.*"),
        "Has cap W in name",
        "No cap W in Name")

0 Kudos

Thanks for the reply.

In my SAC story I can not see the calculated dimension option under Builder Panel.capture2.pngcapture1.png

Please find attached screenshot and please suggest.

Thanks

0 Kudos

Thanks for your suggestion.

It was live connection that is why "create calculated dimension" option was not avaiable with us.

But this time again I am trying to write below formula using LIKE function

but getting err.."Formula could not be completed..choose property for dimension DESCRIPTION..."

Would really appriciate if you can help me.

thanks

former_member542603
Participant
0 Kudos

Hi Neha,

You can create a calculated measure in the Builder Panel using the below formula.

IF(Like([company_name].[company_name], ".*ABC.*"), [new_grp_name].[new_grp_name], [company_name].[company_name])

Let me know if this matches your requirement.

-Sathya

0 Kudos

Hi

Please find attached error.

capture.png

Also why we have to write company_name.company_name

Please suggest.

Thanks

former_member542603
Participant
0 Kudos

Hi Neha,

It is like "Dimension_Name.ID".

As mentioned by Narashimman Pls try Ctrl+Space after the dimension.

- Sathya