Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics RMS (Archived)

Top Items Report by Mother Code (Matrix Item)

(0) ShareShare
ReportReport
Posted on by

Hi There, and thanks in advance for any help.

We are looking for the standard report in Sales > Top Performers > Top Items, to group the Item Look up by Mother code but also to show standard items. 

Currently each individual matrix item of a mother code shows on the report as a seprarte line.

Many thanks, Alex

The code for the Top Items Report is as follows:

//--- Report Summary --- //

Begin ReportSummary    ReportType = reporttypeSales    ReportTitle = "Top Items Report"    PageOrientation = pageorientationPortrait    OutLineMode = True    Groups = 0    GroupDescription = ""    DisplayLogo = True    LogoFileName = "MyLogo.bmp"    ProcedureCall = ""    TablesQueried = "FROM TransactionEntry WITH(NOLOCK)  INNER JOIN [Transaction] WITH(NOLOCK) ON TransactionEntry.TransactionNumber = [Transaction].TransactionNumber LEFT JOIN Item WITH (NOLOCK) On TransactionEntry.ItemID = Item.ID"    SelCriteria = ""    GroupBy = "Item.ItemLookupCode"    SortOrder = "Sales DESC" End ReportSummary

//--- Title Rows ---//

Begin TitleRow    Text = "<Store Name>"    Font = "Arial"    FontBold = True    FontSize = 16    Color = "Blue" End TitleRow

Begin TitleRow    Text = "<Report Title>"    Font = "Arial"    FontBold = True    FontSize = 12    Color = "Black" End TitleRow

Begin TitleRow    Text = "Generated On <Report Date>"    Font = "Arial"    FontBold = True    FontSize = 10    Color = "Black" End TitleRow

//--- Filters ---//

Begin Filter    FieldName = "[Transaction].Time"    FilterOp = reportfilteropBetween    FilterLoLim = "<YearStart>"    FilterHilim = "<Today>" End Filter

//--- Columns ---//

Begin Column    FieldName = "ItemLookupCode"    DrillDownFieldName = "Item.ItemLookupCode"    DrillDownReportName = ""    Title = "Item Lookup Code"    VBDataType = vbString    Formula = "MAX(Item.ItemLookupCode)"    ColHidden = False    ColNotDisplayable = False    FilterDisabled = False    ColWidth = 2055    GroupMethod = groupmethodNone    ColFormat = "" End Column

Begin Column    FieldName = "ItemDescription"    DrillDownFieldName = ""    DrillDownReportName = ""    Title = "Description"    VBDataType = vbString    Formula = "MAX(Item.Description)"    ColHidden = False    ColNotDisplayable = False    FilterDisabled = False    ColWidth = 2835    GroupMethod = groupmethodNone    ColFormat = "" End Column

Begin Column    FieldName = "[Transaction].Time"    DrillDownFieldName = ""    DrillDownReportName = ""    Title = "Date Sold"    VBDataType = vbDate    Formula = ""    ColHidden = True    ColNotDisplayable = True    FilterDisabled = False    ColWidth = 1035    GroupMethod = groupmethodNone    ColFormat = "" End Column

Begin Column    FieldName = "QtySold"    DrillDownFieldName = ""    DrillDownReportName = ""    Title = "Qty Sold"    VBDataType = vbDouble    Formula = "SUM(TransactionEntry.Quantity)"    ColHidden = False    ColNotDisplayable = False    FilterDisabled = False    ColWidth = 1710    GroupMethod = groupmethodSum    ColFormat = "#.##" End Column

Begin Column    FieldName = "Sales"    DrillDownFieldName = ""    DrillDownReportName = ""    Title = "Sales"    VBDataType = vbCurrency    Formula = "SUM(TransactionEntry.Price * TransactionEntry.Quantity)"    ColHidden = False    ColNotDisplayable = False    FilterDisabled = False    ColWidth = 1830    GroupMethod = groupmethodSum    ColFormat = "" End Column

Begin Column    FieldName = "Profit"    DrillDownFieldName = ""    DrillDownReportName = ""    Title = "Profit"    VBDataType = vbCurrency    Formula = "SUM((TransactionEntry.Price - TransactionEntry.Cost) * TransactionEntry.Quantity)"    ColHidden = False    ColNotDisplayable = False    FilterDisabled = False    ColWidth = 1815    GroupMethod = groupmethodSum    ColFormat = "" End Column

*This post is locked for comments

  • Community Member Profile Picture
    on at
    RE: Top Items Report by Mother Code (Matrix Item)

    is this still available I too would like a report that groups my matrix

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Top Items Report by Mother Code (Matrix Item)

    You can get Matrix reporting with the Store Utilities from Retail Realm, which you can get for free.

  • Alex R Profile Picture
    on at
    RE: Top Items Report by Mother Code (Matrix Item)

    Thanks for the reply.  I'm not sure how to convert this into the RMS report.  Are you able to help on this?

    Thanks, Alex

  • Community Member Profile Picture
    on at
    RE: Top Items Report by Mother Code (Matrix Item)

    The below query will do the job for u, try to convert it to RMS report, the idea of the query is to union 2 queries, one for the matrix items and the other one for the standard items, then select the top x items from the combination of the 2 queries by value

    select top 10 itemlookupcode,description,qty, amount

    from

    (SELECT itemclass.itemlookupcode, Itemclass.Description

    ,sum(TransactionEntry.Quantity) as Qty, sum(TransactionEntry.Quantity*TransactionEntry.Price)as Amount

    FROM [Transaction] INNER JOIN TransactionEntry

    ON [Transaction].TransactionNumber=TransactionEntry.TransactionNumber

    inner JOIN Item ON TransactionEntry.ItemID=Item.ID

    INNER JOIN ItemClassComponent ON Item.ID=ItemClassComponent.ItemID

    inner join ItemClass ON ItemClass.ID=ItemClassComponent.ItemClassID

    group by itemclass.itemlookupcode, Itemclass.Description

    union

    SELECT item.itemlookupcode, Item.Description

    ,sum(TransactionEntry.Quantity) as Qty, sum(TransactionEntry.Quantity*TransactionEntry.Price)as Amount

    FROM [Transaction] INNER JOIN TransactionEntry

    ON [Transaction].TransactionNumber=TransactionEntry.TransactionNumber

    inner JOIN Item ON TransactionEntry.ItemID=Item.ID

    left JOIN ItemClassComponent ON Item.ID=ItemClassComponent.ItemID

    where ItemClassComponent.ItemID  is null

    group by item.itemlookupcode, Item.Description

    ) t1

    order by amount desc

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,217 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,978 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans