+ Reply to Thread
Results 1 to 12 of 12

Merge Table with Power Query. Primary Key with Duplicate values

  1. #1
    Registered User
    Join Date
    07-09-2017
    Location
    Chittagong
    MS-Off Ver
    365
    Posts
    16

    Question Merge Table with Power Query. Primary Key with Duplicate values

    Hello

    Attach an excel file Name ?Factory?
    3 Different departments will input data separately.
    ( Input Data = Mark in Yellow)
    Sheet: Merchandising = Table Name: Merchant
    Sheet: Com_Imp = Table Name: Com_BBLC
    Sheet: Com_Imp = Table Name: Com_Imp
    Sheet: Com_Exp = Table Name: Com_Exp

    Sheet Name ?Result?,
    I try to collect all data from all tables into a Master Table.

    Try to get different kinds of results from the Master Table using Pivot table
    But my result comes WRONG only the reason Primary key ?Order Number? is duplicate
    Result I try to find in Main sheet Cell no :AM2
    Result comes :
    JMS Order No: 001
    Qty is OK: 50000+60000+7000=180000
    The amount is OK: 589,000
    BBLC Value is wrong: 418,190 should be 429,970
    IMP Value is wrong: 388,560 should be 429,790
    Exp Value is wrong: 259,000 should be 587,350

    The only reason of this wrong calculation is ?Order Number? is duplicate
    I marked in RED all the Tables.

    I tried query with Merge.
    Attached Files Attached Files

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Merge Table with Power Query. Primary Key with Duplicate values

    is that what you want?


    Order No JMS-001-22
    Qty_e Sum of Merchant.Amount Sum of Com_BBLC.BBLC-Amount Sum of Com_Imp.Amount Sum of Exp Amt
    25000
    23560000
    12899100
    10314960
    9600000
    29500
    11780000
    6449550
    5157480
    5841000
    30000
    11780000
    6449550
    5157480
    5940000
    70000
    11780000
    6449550
    5157480
    13860000
    Grand Total
    58900000
    32247750
    25787400
    35241000

  3. #3
    Registered User
    Join Date
    07-09-2017
    Location
    Chittagong
    MS-Off Ver
    365
    Posts
    16

    Re: Merge Table with Power Query. Primary Key with Duplicate values

    No sandy666
    this is not what i want

  4. #4
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Merge Table with Power Query. Primary Key with Duplicate values

    Quote Originally Posted by fkarim74 View Post
    No sandy666
    this is not what i want
    sorry about that

  5. #5
    Registered User
    Join Date
    07-09-2017
    Location
    Chittagong
    MS-Off Ver
    365
    Posts
    16

    Re: Merge Table with Power Query. Primary Key with Duplicate values

    If you check my excel sheet
    you found

    order number JMS-001-22

    #
    Order qty is : 180,000 Pcs
    Amount: $ 589,000

    #
    BBLC : $ 429,970

    #
    Import : $ 429,790

    #
    Export : $ 587,350

  6. #6
    Registered User
    Join Date
    07-09-2017
    Location
    Chittagong
    MS-Off Ver
    365
    Posts
    16

    Re: Merge Table with Power Query. Primary Key with Duplicate values

    There are
    3 sheets
    (Merchandising, Com_Imp, Com_Exp)

    4 Tables
    (Merchant, Com_BBLC, Com_Imp, Com_Exp)

    from these tables, the Primary key or lookup value is "Order Number"

    Order wise I need all information as per requirements

    Hope understand.

  7. #7
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Merge Table with Power Query. Primary Key with Duplicate values

    do you know BBLC and Import doesn't contains QTY ?

  8. #8
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Merge Table with Power Query. Primary Key with Duplicate values

    maybe this one

    Order No JMS-001-22
    QTY Sum of Merchant Sum of BBLC Sum of Import Sum of Export
    25000
    160000
    29500
    97350
    30000
    99000
    50000
    160000
    60000
    198000
    70000
    231000
    231000
    (blank)
    429970
    429790
    Grand Total
    589000
    429970
    429790
    587350

  9. #9
    Registered User
    Join Date
    07-09-2017
    Location
    Chittagong
    MS-Off Ver
    365
    Posts
    16

    Re: Merge Table with Power Query. Primary Key with Duplicate values

    Yes

    //do you know BBLC and Import doesn't contains QTY ?//

    BBLC and Import is related with the amount

  10. #10
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Merge Table with Power Query. Primary Key with Duplicate values


  11. #11
    Registered User
    Join Date
    07-09-2017
    Location
    Chittagong
    MS-Off Ver
    365
    Posts
    16

    Re: Merge Table with Power Query. Primary Key with Duplicate values

    Thanks Sandy.

    I am working on it.

  12. #12
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Merge Table with Power Query. Primary Key with Duplicate values

    My pleasure

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Power Query drawing through Calendar Data OK but Pivot Table shows incorrect values
    By Showpiece11 in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 04-05-2022, 03:02 PM
  2. [SOLVED] Merge rows in power query
    By amitdi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-17-2021, 07:46 PM
  3. [SOLVED] merge table into power query and keep greater date
    By Undo in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 09-18-2021, 09:36 AM
  4. [SOLVED] Merge Pro tip in Power Query
    By hudson andrew in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-29-2021, 03:53 AM
  5. Power Query Merge only the First Instance
    By c4revolution in forum Excel General
    Replies: 1
    Last Post: 04-13-2021, 04:35 AM
  6. Power query merge column
    By Eric Tsang in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-17-2020, 09:08 AM
  7. Replies: 9
    Last Post: 11-29-2017, 01:32 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1