cancel
Showing results for 
Search instead for 
Did you mean: 

How to use case statements in SAC

0 Kudos

Hi Guys,

I want to write a case statements in Cloud Analytics. How can I write? Please provide the sample syntax...

TammyPowlas
Active Contributor
0 Kudos

Do you mean Analytics Designer? So far I can't locate it in the SAP Help - https://help.sap.com/viewer/00f68c2e08b941f081002fd3691d86a7/release/en-US/afe93e3cf1414a7b8419baad1... - you may want to check it too

Accepted Solutions (0)

Answers (3)

Answers (3)

kgrzymala3
Explorer

Hello,

I hope it helps:

var KG = Dropdown_1.getSelectedKey();
console.log(KG);
switch (KG){
 case "1": console.log("CASE 1");
 break;
 case "2": console.log("CASE 2");
 break;
 case "3": console.log("CASE 3"); 
 break;
 default: console.log("CASE 99");
}

Regards,

Krzysztof

nikhil_joy2
Active Contributor

You can write Switch..case statement in Designer.

-Nikhil Joy

amitrathi239
Active Contributor
0 Kudos

You can achieve similar of CASE statement with IF-ELSE condition.Have you tried with if-else?