Altering Line Item Formula with lookup
Hello fellow community users! I was wondering if anyone else had issues changing line item formula with lookup with the following error message: "format of mapping used for lookup doesn't match any dimension of the source" and what to do to remedy the situation.
Thanks in advance!
Comments
-
Hello @john.roesser
My guess is that you are using a lookup value -in the LOOKUP statement - that doesn't correspond to any dimension in the source target you are referencing in the same formula.If you provide an example or a screenshot, I can help you with the formula.
0 -
0
-
Hello @john.roesser
From the formula I see you are looking up the bonus from the Emp 01 module using 3 values:1. Department
2. Country
3. Role
meaning you are passing these 3 values from the target module Emp 02 to Sys 08.
Do you actually have Country in the Emp 02 to pass?Let me know if you still need hekp
1 -
@einas.ibrahim I do for country but not for role, let me reconfigure to EMP03 and see what happens. Should it look something like: IF Employed? THEN Salary * 'EMP01 Employee Drivers'.Bonus %[LOOKUP: 'SYS08 Employee Details'.Department, LOOKUP: 'SYS08 Employee Details'.Country] ELSE 0, 'EMP03 Employee Drivers by Role'.Bonus %[LOOKUP:'SYS08 Employee Details'.Role]
0 -
@einas.ibrahim The IF Employed? THEN Salary * 'EMP01 Employee Drivers'.Bonus %[LOOKUP: 'SYS08 Employee Details'.Department, LOOKUP: 'SYS08 Employee Details'.Country] ELSE 0, 'EMP03 Employee Drivers by Role'.Bonus %[LOOKUP:'SYS08 Employee Details'.Role] ELSE 0 gave a response as invalid this time. Are you seeing anything in the lookup that is not correct?
0 -
Hello @john.roesser
Let me explain the concept again because it is usually confusing to beginners (and some not so beginners 🙂)
This is the step by step logical thinking one should use to arrive at the formula. Of course, once you understand the concepts you would automatically do all this in one step.
Q: What are we trying to accomplish?
A: Find out the Bonus % for a particular employee in the Target Module Emp02 ( a Target Module is where we are writing the formula)Q: Where can we find the Bonus % information/values?
A: In Emp03. This is the Source Module since it contains the data we are looking for.Q: What information do we need to provide to the Source module -Emp03- to return a single value? in other words, what is Emp 03 dimensioned by?
A: Emp03 is dimensioned by E1 Department and Role.
This basically means if we give Emp03 a Department and a Role we will get the Bonus % for this Department and Role.Q: Do we have this information required by Emp03 (Department, Role) in our Target Module Emp02 to be able to query Emp03 and return the Bonus % for a particular employee? (the data we are looking for?)
A: Short answer is NO, The department and role data are not included in Emp02. This means we can't query Emp03 directly.Q: What do we do then?
A: We find an intermediary module that we can query using the information we have in Emp02 - #E2 in this case- to return the information I need - department and role.Q: Where can I find the employee department and role?
A: In SYS08. This is our Mapping Module.
Q: What do we do now?
A: We query the Source (Emp03) for the Bonus % by giving it the department and role information it requires. The way to provide this information to Emp03 is to use an intermediary SYS08 to give us department and role which in turn we pass to Emp03
The way we construct all this in a formula would be something like this:
Target Module. Line Item = Source Module. LineItem[LOOKUP: mapping module.data 1 required by Source Module, LOOKUP: mapping module. data 2 required by Source Module, LOOKUP: mapping module.data 3 .....and so on ]
Notice that Country didn't come up which means we don't need it.
Please read the above steps carefully and let me know if I need to clarify anything.
After you digest the information, write the formula, test it, and send it to me to make sure you got everything right.26 -
Wow thank you very much for the detailed description! From the information I read, I understood that the formula is :
IF Employed? THEN Salary * 'EMP03 Employee Drivers by Role'.Bonus %[LOOKUP: 'SYS08 Employee Details'.Department, LOOKUP: 'SYS08 Employee Details'.Role] ELSE 0
Because EMP03 bonus is the source module line item needed, and then LOOKUP SYS08 department and role are the mapping due to containing the necessary information, while country is no longer needed and that was deleted. I did not receive an error when I entered that into the EMP02 Bonus blueprint formula. Am I missing anything from the formula?
0 -
Nope, you are good to go.
If you found my response helpful, please mark it as a solution so others can find more easily.1 -
I just did! Thanks again!
0 -
I got the same formula entered but came back with "Data mismatch: format other than LIST or Date being referenced as a relation". Please help fellow community!
0 -
Hi @einas.ibrahim !
That's a great structured and clear explanation!
Also schema with modules (about how it works) is very helpful!
It helped me to understand much better!
Thank you very much!
0 -
Thanks einsas.ibrahim for Step by step process
0 -
i follow the step by step you provide and it so helpful i get the formula but when i enter/apply it the to the E2 i get an error which i attached. please help where is my mistakes? i have include those error as i try twice differently
0 -
Hi
I have seen this in L1 also:
- firstly explore the aguments required for LOOKUP: https://help.anaplan.com/f8baa402-606d-4764-a349-d8003fa383be-LOOKUP e.g.
Values to lookup Number, Boolean, date, time period, list, or text line item
- secondly once you beleive your mappings/arguments are correct; look at what you are trying to map :e.g if the list you are referencing does not have a top level, this will cause the error also:
Hope this helps.
Ravinder
1 -
@erijustine
Are you sure you followed the instructions step by? and that you understand the purpose of each step? Because it certainly works. Please reread the instructions step by step and ensure you understand why you are doing each step.The First error message you screenshot about the automatic sum is usually caused by failing to provide a list item in your LOOKUP, that the target module is expecting (because it is dimensioned by that item's list). For example, which role you need the information for. When you don't provide a particular list item for a list used as the dimension in the source module, the Anaplan Engine assumes you want the data for all the roles in the list, That's why it looks for the Top Level as that where the aggregate information is. While adding a top level as suggested by
Will probably make the error go away, it doesn't mean it will produce the correct result. It is also against Best Practice to add a top level to lists if you don't need it causes performance issues.
Check here to understand Top Level
A possible reason for the second error is that Bonus% has a non-alphanumeric, which means you have to single quotes around the name.
Good Luck1