cancel
Showing results for 
Search instead for 
Did you mean: 

can we filter filter based on transactional data ?

former_member269849
Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

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

Thank you so much Vadim for your kind help.

Answers (3)

Answers (3)

former_member186338
Active Contributor
0 Kudos

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

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?

former_member186338
Active Contributor
0 Kudos

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?)?

former_member269849
Participant
0 Kudos

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 ?

former_member186338
Active Contributor
0 Kudos

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