Skip to Content
0

Scrpit logic question

Dec 29, 2016 at 03:37 PM

114

avatar image
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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
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
10 |10000 characters needed characters left characters exceeded
Former Member

Yes thank you so much Vadim for your kind help.

0

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

0
Former Member
Vadim Kalinin

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

0
Former Member
Vadim Kalinin

Hi Vadim

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 ?

thanks in advance.

regards

0

Member formulas are used for different purpose then script logic.

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

0
Former Member
Vadim Kalinin

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

0

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!

0
Show more comments
avatar image
Former Member Jan 05, 2017 at 11:52 AM
0
sample.png

Hi Vadim ,

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
10 |10000 characters needed characters left characters exceeded
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
10 |10000 characters needed characters left characters exceeded
Former Member

Thank you so much Vadim for your kind help.

0

Sample:

Formula for member DIREXPPNS

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

Report:

direxp.png (8.1 kB)
1
Former Member
Vadim Kalinin

That's what I needed than u so much Vadim .

0