cancel
Showing results for 
Search instead for 
Did you mean: 

FOR EACH LOOP - Performance issues - Data Action Triggers

filomena_sap_1997
Discoverer
0 Kudos

Hello everyone,

I'm a beginner in the development of Data Action triggers, I need help because i have to calculate the increase of the salary for each employee based on the % bonus and on the fixed salary. In the advanced formula steps I've wrote this code :

and it works fine for this purpose, the problem is that it takes too much time because of the for each loop that is too heavy (it takes about 20 minutes).

Is there any suggestion on how to calculate this measures for each employee once at a time without using the loop statement? I would very appreciate also a workaround (like creating a property on the Employee dimension or something like this)

Many thanks for any help,

Filomena.

AlexGourdet
Community Manager
Community Manager
0 Kudos

Hi,

Please consider changing your username as it's currently using SAP Copyrighted name which is a violation of the rules of engagement.

You may request a username change to our email: sapcommunity@sap.com

Regards,

Alex

Accepted Solutions (0)

Answers (1)

Answers (1)

N1kh1l
Active Contributor
0 Kudos

filomena_sap_1997

In most cases FOREACH is not required. Just see if you really need the FOREACH as its a expensive statement in terms of execution. You could have put a copy of your code instead of snapshot for better readability. Also use Variable members of Dimension/measure instead of @variables of type integer or float.

Br.

Nikhil