Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
I made an attempt at solving this using Json and the eval() function. The first step is to create Json. The Json key contains a single line Python if statement that will evaluate to true or false if the variable "val" is within the range. In the event of being it true, the fee amount to be charged is contained in the Json value.
After the Json has been constructed, we then bring it in as a field in the main dataset and then proceed to execute each of the Json keys (as they are actually Python statements) using eval(). When we get a true result, we can extract the fee amount from the Json value. The code is relatively simple, you just need some understanding of Json and eval().
You can read more about eval() here.
Attached files
Fee Range - 18 Aug 2021.lna