Skip to Content
0

can we filter filter based on transactional data ?

Mar 07, 2017 at 06:21 PM

45

avatar image
Former Member

Hi experts,

I want to calculate the price based on the inputed value of another KPI.

my model have the below dimensions:

Article

Slice: members: 1 , 2 ,3 and NA(Non Applicable)

Version :C type

Time.

Supplier

TV_PDT: The account dimension where i have my KPIs , I have quantity and price .

normaly if the quantity is ≤100 T the price will be 1200 DH/T,if it's between 101T and 250 T the price is 1150 DH/T and if it's >250 T the price will be 1100 DH/T.

is it possible ?if yes how can I achieve that.

what I suggest is to input quanity for Slice=NA and then if the quantity is

is ≤100 we do a rec statement and save data for Slice =1 and crash the record for Slice=NA

same for other slices.

regards

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

4 Answers

Best Answer
Vadim Kalinin Mar 07, 2017 at 08:16 PM
0

If you want to store also price:

*WHEN TV_PDT
*IS quantity
*WHEN Slice
*IS NA
*REC(EXPRESSION=%VALUE%<=100 ? %VALUE% : 0,Slice=1)
*REC(EXPRESSION=%VALUE%>100 ? (%VALUE%<=250 ? %VALUE% : 0)  : 0,Slice=2)
*REC(EXPRESSION=%VALUE%>250 ? %VALUE% : 0,Slice=3)
*REC(EXPRESSION=%VALUE%<=100 ? 1200 : 0,Slice=1,TV_PDT=price)
*REC(EXPRESSION=%VALUE%>100 ? (%VALUE%<=250 ? 1150 : 0)  : 0,Slice=2,TV_PDT=price)
*REC(EXPRESSION=%VALUE%>250 ? 1100 : 0,Slice=3,TV_PDT=price)
*REC(EXPRESSION=0) //Clear NA
*ENDWHEN
*ENDWHEN
Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thank you so much Vadim for your kind help.

0
Vadim Kalinin Mar 07, 2017 at 06:26 PM
0

Sorry but not clear...

Where do you want to perform this conditional calculation?

On the report with Excel formula?

Or in script logic (default.lgf?)?

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

on the default.lgf.

by script logic.

what I suggest is to input quanity for Slice=NA and then if the quantity is

is ≤100 we do a rec statement and save data for Slice =1 and crash the record for Slice=NA

same for other slices.

is it a good approach ?

0

Not clear how do you want to save Price???

0
Vadim Kalinin Mar 07, 2017 at 06:37 PM
0

Ok, now it's clear that you are talking about script logic!

But the calculation logic is not clear:

"what I suggest is to input quanity for Slice=NA and then if the quantity is

is ≤100 we do a rec statement and save data for Slice =1 and crash the record for Slice=NA

same for other slices."

You want to input quantity for Slice=NA and depending on the value post to 1, 2, 3?

Share
10 |10000 characters needed characters left characters exceeded
Vadim Kalinin Mar 07, 2017 at 08:10 PM
0

The following code will do the job (just to copy quantity):

*WHEN Slice
*IS NA
*REC(EXPRESSION=%VALUE%<=100 ? %VALUE% : 0,Slice=1)
*REC(EXPRESSION=%VALUE%>100 ? (%VALUE%<=250 ? %VALUE% : 0)  : 0,Slice=2)
*REC(EXPRESSION=%VALUE%>250 ? %VALUE% : 0,Slice=3)
*REC(EXPRESSION=0) //Clear NA
*ENDWHEN
Share
10 |10000 characters needed characters left characters exceeded