cancel
Showing results for 
Search instead for 
Did you mean: 

Scrpit logic question

former_member269849
Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

Not 100% clear but:

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

former_member269849
Participant
0 Kudos

Yes thank you so much Vadim for your kind help.

former_member186338
Active Contributor
0 Kudos

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

former_member269849
Participant
0 Kudos

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

former_member269849
Participant
0 Kudos

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

former_member186338
Active Contributor
0 Kudos

Member formulas are used for different purpose then script logic.

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

former_member269849
Participant
0 Kudos

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_member186338
Active Contributor
0 Kudos

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_member269849
Participant
0 Kudos

yes I want to use KPI just in report , I mean by aggregation the sum in parent.

here is the example capture.png

I do not want to have the negatif results in stand of having -17 in total of EXTR03 I sould have 2 , I should sum just positif resulat .

I don't know if I explain my needs very well please if i dont tell me.

former_member186338
Active Contributor
0 Kudos

Member formulas are calculated AFTER aggregation!

Do you understand this sentence?

And your sample is not clear: add the line with the desired result!

Plus - explain the formula in the sample!

Answers (2)

Answers (2)

former_member186338
Active Contributor
0 Kudos

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,...,...)

former_member269849
Participant
0 Kudos

Thank you so much Vadim for your kind help.

former_member186338
Active Contributor

Sample:

Formula for member DIREXPPNS

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

Report:

former_member269849
Participant
0 Kudos

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

former_member269849
Participant
0 Kudos
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.