on 2017 Mar 07 6:21 PM
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
Request clarification before answering.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?)?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 7 | |
| 7 | |
| 6 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.