Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
ranibosch
Creator
Creator

Join next to specific value in a field

Good day, please refer to my scrip below:

//************************DEFAULT DIMENSION ON ITEMS***********************

DefaultDimension:

Load

    "No_" as "Item No",

    "Dimension Code" as "Trending Code",

  "Dimension Value Code" as "Trending Value";

SQL SELECT

"No_",

    "Dimension Code",

    "Dimension Value Code"

FROM "DynamicsNAV90_Prod".dbo."Ambassador Foods (Pty) Ltd$Default Dimension"

where "Dimension Code" in ('CHANNEL', 'MFGTYPE', 'PACKSIZE', 'SERVICE');

******************************************************************************************************
I would like to join a field from another table called "Packsize UOM".
So basically it should do a vlookup on the trending value for packsize trending codes only, and then return the "Packsize UOM" next to each trending value
1 Solution

Accepted Solutions
prma7799
Master III
Master III

Try like this

DefaultDimension:

Load

    "No_" as "Item No",

    "Dimension Code" as "Trending Code",

  "Dimension Value Code" as "Trending Value";

SQL SELECT

"No_",

    "Dimension Code",

    "Dimension Value Code"

FROM "DynamicsNAV90_Prod".dbo."Ambassador Foods (Pty) Ltd$Default Dimension"

Left join (DefaultDimension)

"Item No",

"Packsize UOM"

FROM "DynamicsNAV90_Prod".dbo."Ambassador Foods (Pty) Ltd$Unit of Measure"

where "Trending Code" = 'PACKSIZE';

View solution in original post

4 Replies
sunny_talwar

Would you be able to share a sample to show what exactly you are looking to do?

ranibosch
Creator
Creator
Author

Please see screenshot below of field I would like to add:

Joining tables.JPG

prma7799
Master III
Master III

Try like this

DefaultDimension:

Load

    "No_" as "Item No",

    "Dimension Code" as "Trending Code",

  "Dimension Value Code" as "Trending Value";

SQL SELECT

"No_",

    "Dimension Code",

    "Dimension Value Code"

FROM "DynamicsNAV90_Prod".dbo."Ambassador Foods (Pty) Ltd$Default Dimension"

Left join (DefaultDimension)

"Item No",

"Packsize UOM"

FROM "DynamicsNAV90_Prod".dbo."Ambassador Foods (Pty) Ltd$Unit of Measure"

where "Trending Code" = 'PACKSIZE';

ranibosch
Creator
Creator
Author

Thank you..