Hi,
Do like this, actually in your case sum is taking place before the condition check for discount type
do a little change in mapping
DiscntType--removeContext-- EqulsS-------IfWithoutElse----Amount---removecontext--then---SUM- Connstatnt(Value) --->GrandAmount
Thanks!
hi
you can try like that.
amount -
> remove context---->sort by key(disocountType(remove contect))
here sort the maount value by keeping discount type as key...
regards,
navneet
Edited by: navneet sumit on Nov 26, 2008 8:30 AM
Hi,
Use the mapping like below..
disocountType(same context)
-equalsS(TextFunction)
IfWithouElse
amount(Parent Context)(Then)
-->
disocountType(Parent Context)
->RemoveContext
Sum(Statistic Function)
-Target(amount).
Regards,
Prakasu
Edited by: prakasu on Nov 26, 2008 8:23 AM
Hi,
Please use the mapping below:
for the discountTotals node:
discountType --> removeContext --> sort: Lexicographical(case insensitive) --> splitByValue:ValueChanged --> collapseContext --> discountTotals
this creates the discountTotals node based on the number of the discountType unique occurrences
for the discountType node:
discountType --> removeContext --> sort: Lexicographical(case insensitive) --> splitByValue:ValueChanged --> collapseContext --> splitByValue:eachValue --> discountType
same as above, e.g. if only P and K are declared, then the mapping will only output a P and a K once
for the amount node:
discountType --> removeContext --> sortByKey:(LexicographicalCaseInsensitive) 1.
amount --> removeContext -->
discountType ->removeContext ->sort:Lexicographical(CaseInsensitive) ->splitByValue:ValChngd 2.
node from 1. --> formatByExample --> sum --> amount
node from 2. -->
before you can do a total for each type (P or K), you have to use formatByExample to separate which values belong to P or K. The mapping also took into account that the occurrence order could be P,K,P,K...so that using formatByExample with sort will result to P,P,K,K.
Regards,
disocountType \ ------------equalS----\ Constant[K] / ----------ifWitoutElse---- removeContext-------sum(from statistics group)----target amount--/
ifWitoutElse 2 inputs :-
1. check whether discount type equals K
2.amount
Don't change content of any of the input. removeContext will carry all amounts whose discountType is K, sum will add up all amounts.
Add comment