0

# Scrpit logic question

Dec 29, 2016 at 03:37 PM

114

Former Member

Hi exprets ,

I have the abose KPIs that i want to claculate :

EXTR01 :inputed value

EXTR02:Calculated KPI which is EXTR01-0,3.

EXTR03:The cumulative value of EXTR02.

when I 've EXTRP 01 empty I have in the agregation in parent(Total month):-9,3

the cumulative value of every day of the month because EXTR01 is empty.

what Can do to have this algorithm

If EXTR01 is empty

EXTR02=(EXTR01-0,3)*0

else

EXTR02=EXTR01-0,3.

tahnk you .

regards

Vadim Kalinin Dec 29, 2016 at 03:44 PM
0

Not 100% clear but:

*WHEN ACCOUNT
*IS EXTR01
*REC(EXPRESSION=(%VALUE%==0) ? 0 : %VALUE%-0.3, ACCOUNT=EXTR02)
*ENDWHEN

Show 9 Share
Former Member

Former Member

But if you have no record for EXTR01 anyway the loop will not execute :)

Former Member

yes but sometimes they execute it and then they want to crash the number by 0 .

Former Member

Please can we do the same thing using member formula for example if the result is <0 we should put 0 as result ?is it possible ? if yes how can I achieve that ?

regards

Former Member

Member formulas are used for different purpose then script logic.

Can you explain the scenario in details? What do you want to achieve?

Former Member

I have a calculation of a KPI for example

EXTR03=EXTR01-EXTR02

Some times when I have EXTR01 empty I have in result -EXT02 this is nefatif and affect aggregation .

what I want to achieve is for example if EXTR01-EXTR02<0 result is 0 else EXTR01-EXTR02

Former Member

This is not a scenario explanation!

Do you want to use this KPI in report only? What do you mean by "aggregation"?

Member formulas are calculated AFTER aggregation!

Former Member Jan 05, 2017 at 11:52 AM
0
sample.png

thanks for your help , I know that member formulas are calculated after aggregation , that's why I need to use member formula and not script logic..

Here is the real example and the real formula

I'm asking if for example the denominator is 0 or <0 the result of EXTR07 is 0.i'm just asking if its possible or not.

regards.

sample.png (20.2 kB)
formula.png (33.4 kB)
Share
Vadim Kalinin Jan 05, 2017 at 12:09 PM
0

I am not able to understand your report logic completely, but you can always use IIF in member formula to test value:

=IIF([EXTRxx]<0.3,...,...)

Show 3 Share
Former Member

Former Member

Sample:

Formula for member DIREXPPNS

IIF([106]<0.3,0,[106]-0.3);SOLVE_ORDER=10

Report:

direxp.png (8.1 kB)
Former Member