Skip to Content
0
Former Member
May 20, 2008 at 11:32 AM

Transformation formular with variables

17 Views

Hello everyone!

I have a problem My formula is to long.

IF( /BIC/ZC_CALLB = 1, IF( /BIC/ZK_NDSTTG <> 0, IF( ( ( /BIC/ZK_NDSTTG - /BIC/ZK_T01TG ) * 24 * 60 ) + /BIC/ZK_NDSTUR - /BIC/ZK_T01UR <= 2, '<= 2', IF( ( ( /BIC/ZK_NDSTTG - /BIC/ZK_T01TG ) * 24 * 60 ) + /BIC/ZK_NDSTUR - /BIC/ZK_T01UR <= 5, '<= 5', IF( ( ( /BIC/ZK_NDSTTG - /BIC/ZK_T01TG ) * 24 * 60 ) + /BIC/ZK_NDSTUR - /BIC/ZK_T01UR <= 10, '<= 10', IF( ( ( /BIC/ZK_NDSTTG - /BIC/ZK_T01TG ) * 24 * 60 ) + /BIC/ZK_NDSTUR - /BIC/ZK_T01UR <= 15, '<= 15', IF( ( ( /BIC/ZK_NDSTTG - /BIC/ZK_T01TG ) * 24 * 60 ) + /BIC/ZK_NDSTUR - /BIC/ZK_T01UR <= 30, '<= 30', IF( ( ( /BIC/ZK_NDSTTG - /BIC/ZK_T01TG ) * 24 * 60 ) + /BIC/ZK_NDSTUR - /BIC/ZK_T01UR <= 45, '<= 45', 'IF( ( ( /BIC/ZK_NDSTTG - /BIC/ZK_T01TG ) * 24 * 60 ) + /BIC/ZK_NDSTUR - /BIC/ZK_T01UR <= 60, '<= 60', IF( ( ( /BIC/ZK_NDSTTG - /BIC/ZK_T01TG ) * 24 * 60 ) + /BIC/ZK_NDSTUR - /BIC/ZK_T01UR <= 90, '<= 90', IF( ( ( /BIC/ZK_NDSTTG - /BIC/ZK_T01TG ) * 24 * 60 ) + /BIC/ZK_NDSTUR - /BIC/ZK_T01UR <= 120, '<= 120', '> 120' ) ) ) ) ) ) ) ) ), 0 ), 'NULL' )

I would like to shrink my formula like the following example but I don't know how to create temp. variables.

var1= ( ( /BIC/ZK_NDSTTG - /BIC/ZK_T01TG ) * 24 * 60 ) + /BIC/ZK_NDSTUR - /BIC/ZK_T01UR
IF( /BIC/ZC_CALLB = 1, IF( /BIC/ZK_NDSTTG <> 0, IF( var1 <= 2, '<= 2', '> 2' )

Thanks for your help.

Regards, Thomas