Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Based on the month condition, I need to populate the value from one row to another. If the CP data has lower terr counts, we must incorporate the ORG terr counts (CP < ORG) in the script.
Kindly help me out.
Expected Output:
CP_Team_Flag | Sales_District | TerrCount |
CP | IN1001 | 1 |
ORG | IN1001 | 1 |
CP | IN1028 | 2 |
ORG | IN1028 | 2 |
CP | IN5002 | 4 |
ORG | IN5002 | 1 |
Thanks in advance.
@dineshm030 Please use the below expression in your Table:
=if(Sales_District=below(Sales_District) and TerrCount<Below(TerrCount), Below(TerrCount), TerrCount)
If this resolves your issue, please like and accept it as a solution.
Hi Sidhiq,
Thanks for your response.
This logic is working at the expression level, but I need it like this at the script level.
Hi @sidhiq91 ,
The logic is working fine without a Business Unit at the expression level.
Once I add the business unit, the value has been changed at the expression level.
Sorting Order :
Kindly help me out.
Thanks in advance.
Hi
For Script level,
if all the fields are coming from same table. you can create one mapping table for "ORG" and bring one more field in the table.
In front end, you can compare the value and use it accordingly.
Ex:
MAPORG:
Mapping
LOAD Sales_District, TerrCount INLINE [
CP_Team_Flag, Sales_District, TerrCount
ORG, IN1001, 1
ORG, IN1028, 2
ORG, IN5002, 1
]where CP_Team_Flag = 'ORG';
LOAD *, ApplyMap('MAPORG', Sales_District, 0) as ORGTerrCount INLINE [
CP_Team_Flag, Sales_District, TerrCount
CP, IN1001, 1
ORG, IN1001, 1
CP, IN1028, 2
ORG, IN1028, 2
CP, IN5002, 4
ORG, IN5002, 1
];
Exp: If(ORGTerrCount > TerrCount, ORGTerrCount, TerrCount)
However, its depends on the cardinality and data.