Skip to main content

Notifications

Announcements

No record found.

Business Central forum
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 69,639 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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,524 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,493 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans