Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good day!
In my model i load main table Sales in load script from excel:
Sales:
LOAD
[Outlet code],
[Nomenclature Id],
Sales
FROM
[Sales by teams].xlsx
(ooxml, embedded labels, table is Sales);
then i join ti this table nomenclature classificator from the same file:
left keep(Sales)
load
[Nomenclature Id],
[Type of product]
FROM
[Sales by teams].xlsx
(ooxml, embedded labels, table is [Nomenclature classification]);
In this file (excel) i also have agent classificator, which is situated in sheet Agents and i join it to table Sales:
left keep(Sales)
load
[Outlet code],
[Agent name],
[Type of team]
FROM
[Sales by teams].xlsx
(ooxml, embedded labels, table is Agents);
Each of outlet codes is connected with two or three agents.
I need connect Agent to sales by priority table which is situated in sheet Assigment sales.
For example:
First Outlet code 22 is connected with three Agents:
Andrey C (Team3)
Boris D (Team2)
Richard M (Team1)
Each of Nomenclature Id must conneted with Agent by min priority of it's Type of product.
Result table for Outlet code 22 must be:
Outlet code | Nomenclature Id | Type of product | Agent name | Sales | |
11 | Nom1 | Type1 | Richard M | 54 | Because for Type of product 'Type1' Type of team 'Team1' have the smallest Priority |
11 | Nom2 | Type1 | Richard M | 33 | Because for Type of product 'Type1' Type of team 'Team1' have the smallest Priority |
11 | Nom3 | Type1 | Richard M | 4 | Because for Type of product 'Type1' Type of team 'Team1' have the smallest Priority |
11 | Nom4 | Type2 | Boris D | 76 | Because for Type of product 'Type2' Type of team 'Team2' have the smallest Priority |
11 | Nom5 | Type3 | Andrey C | 76 | Because for Type of product 'Type3' Type of team 'Team3' have the smallest Priority |
11 | Nom6 | Type3 | Andrey C | 54 | Because for Type of product 'Type3' Type of team 'Team3' have the smallest Priority |
11 | Nom7 | Type3 | Andrey C | 32 | Because for Type of product 'Type3' Type of team 'Team3' have the smallest Priority |
11 | Nom8 | Type3 | Andrey C | 67 | Because for Type of product 'Type3' Type of team 'Team3' have the smallest Priority |
In attachment model and source file.
Please, help!!!
It's very important for me.
Thanks.
Thanks dear!!!!
It's fantastic..