Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Apply filters to multiple tables together in a query

Posted on by 160
Hi everyone, 

I have a query made with the following tables; Price List Header, Price List LineCustomer and Item. I want to filter customer and item on the basis of unit price. Currently, the query outputs same combination of Item and Customer with different unit price. However, I want to show unique combination of Item and Customer. For the records having different unit prices for same Item-Customer combination, I want to filter such record based on lowest unit price. 

For example:
Right now, it outputs:  
CustomerItemUnit Price
Customer1Item14
Customer1Item15
Customer2Item16
 
The result I want:
CustomerItemUnit Price
Customer1Item14
Customer2Item16


I'd appreciate any help or suggestion. Thank you in advance. 
Categories:
  • Ariba Mehdi Profile Picture
    Ariba Mehdi 160 on at
    Apply filters to multiple tables together in a query
    Hi YUN ZHU,

    Thank you for the response. 

    The unit price field exists in Price List Line Table, not Item table.  The hierarchy of the dataitems follow:
    Price List Header
        Price List Line
           Customer
              Item

    Thus, this does not work to filter the unique Item-Customer Combination. 
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,698 Super User 2024 Season 2 on at
    Apply filters to multiple tables together in a query
    Hi, you can try Min method: Retrieves the lowest value of fields in the column within a group.
    For example,
     
    Hope this helps.
    Thanks.
    ZHU

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans