Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
johngouws
Partner - Specialist
Partner - Specialist

Sales Rep Incentive - unrelated tables

Good morning. 

I need create a chart to show a Sales Rep's Incentive % based on Target Achieved %. This expression needs to be in the chart and not in the Load script. 

Looking at the snippet you see the 2 tables that are not related.

REP 01 achieved 90% of Target, therefore I need to look at the Achieved_% field in the lookup table and display the Lookup value. In this case I should display 10%. In the attached App I have attempted a couple of expressions, but after meany hours, I need to escalate the request. 

Thank you in advance. 

Incentive.JPG

6 Replies
arpitkharkia
Creator III
Creator III

You can do a simple association or a left join if you dont need all records from the lookup table.

I hope this is what you need.

PFA

johngouws
Partner - Specialist
Partner - Specialist
Author

Thank you for the reply. 

That would be so simple. Unfortunately that will not work because there are other factors that take place in the UI. 

 

arpitkharkia
Creator III
Creator III

Hey,

I used Lookup() now. PFA.

I hope this makes sense.

 

johngouws
Partner - Specialist
Partner - Specialist
Author

Hi. Thanks so much for still trying. Lookup() cannot be used in a expression in a chart. 

Maybe by creating the Achieved % in the script I caused confusion. In the real world, the user can adjust a variable which impacts on the Achieved %. I have removed the Achieved % from the script and applied more logic to the "Lookup REP incentive" object. Looking at the expression you will see why I cannot do anything in the script. 

arpitkharkia
Creator III
Creator III

Im not sure then, what i can think of now is to use if() function like 

if(Ach%='100%',15%) and so on

But this may not e the best solution.

johngouws
Partner - Specialist
Partner - Specialist
Author

I also initially thought of something like that, but as you say, its not the best. 

Thanks for looking at it though..