Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have the below fields
ID,
Mono,
Group,
Total
CostPerMono,
CostPerGroup
I need to create Costs such that
If an ID has values in either Mono or Group or both,
MonoCost = CostPerMono * Mono
GroupCost = CostPerGroup * Group
If an ID has no values in Mono and Group fields, then
MonoCost = 25% of Total * CostPerMono
GroupCost = 75% of Total * CostPerGroup.
How do I do this in the script ?
Try something like below:
LOAD
ID,
Mono,
Group,
Total
CostPerMono,
CostPerGroup,
CostPerMono * alt(Mono, Total*0.25) as MonoCost,
CostPerGroup * alt(Group, Total*0.25) As GroupCost
Try something like below:
LOAD
ID,
Mono,
Group,
Total
CostPerMono,
CostPerGroup,
CostPerMono * alt(Mono, Total*0.25) as MonoCost,
CostPerGroup * alt(Group, Total*0.25) As GroupCost