Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

get only duplicate value from table

Posted on by 562

Hi All,

I have to display the only duplicate value on SSRS report (customize report ).

In the below image Duplicate values is 10001, This Particular values I Want to show on SSRS report.

Please give share any code to solve this error 

2656.Table.PNG

BR

Tony 

*This post is locked for comments

  • Suggested answer
    Johnkrish Profile Picture
    Johnkrish 781 on at
    RE: get only duplicate value from table

    Hi Tony,

    you can do "Group by" for that Num column. and within the while statement you can check the duplication by checking the count of the record and insert.  Now it will insert only the result having more than one line(which means duplicate).

    For Example:

    SalesLine _salesLine ;

    TestTempTable tempTab;

    while select count(RecId) from _salesLine group by ItemId where _salesLine .SalesId == "SO12345678"
    {
    if(_salesLine .RecId > 1)

    {

    tempTab.SalesId = _salesLine .SalesId;

    tempTab.ItemId= _salesLine .ItemId;

    tempTab.insert();

    info(strFmt("%1 - %2",_salesLine .ItemId,_salesLine .RecId));

    }
    }

  • rohit1900 Profile Picture
    rohit1900 425 on at
    RE: get only duplicate value from table

    Hi Tony,

    say table name is SSRStmpTable

    SSRStmpTable    SSRStmpTabletemp,SSRStmpTableloc;

    while select  SSRStmpTabletemp

    where SSRStmpTabletemp.Num == SSRStmpTableloc.Num 

    && SSRStmpTabletemp.RecID!= SSRStmpTableloc.RecID //recid will be always different 

    {

    //insert record

    }

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans