Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

Select query for creating Pivot table

(1) ShareShare
ReportReport
Posted on by 312
Hello guys,
 
When I have table, lets say we named it TableA that contain these kind of records :
DepartmentTransdateStatusErrorAmount
HQ1/1/2022PostedNo10
HQ1/1/2022PostedError10
HQ1/1/2022NotPostedError10
HQ1/2/2022NotPostedNo10
HQ1/2/2022PostedNo10
BS1/1/2022PostedNo10
BS1/2/2022NotPostedError10
 
And I want to create a pivot table, and because it will be for a report, so I gonna need to insert the pivot table in another table, may I know how to do it, with X++ ?
I have to admit, I'm clueless what I'm gonna do about that record and what's needed to accomplish this in X++ select query.
 
So, the pivot will be like this:
 
DepartmentTransdateStatus: PostedStatus: Not PostedError
  Count AmountCountAmountCount 
HQ1/1/2022220110220
HQ 1/2/202211011000
BS1/1/202211000110
 
Basically, it will to capture and summarize, per Department and dates about :
1. How many are Posted and the amount
2. How many are Not Posted and amount
3. How many are Errors (provided it is posted or not), and the amount
 
Can someone help me ?
 
Thanks in advance.
 
  • Waed Ayyad Profile Picture
    Waed Ayyad 6,556 Super User 2024 Season 2 on at
    Select query for creating Pivot table
    Hi Teevo,
     
    Do you want to show those fields on SSRS report? OR Power BI report? Can you give us more details?
     
     
    Thanks
    Waed Ayyad
  • Kevin Xia Profile Picture
    Kevin Xia Microsoft Employee on at
    Select query for creating Pivot table
    Hi,
    Can you provide more information (such as business logic or what you want to achieve) to help us solve the problem better? At this time, the information you have provided is not sufficient to support us in proposing a solution.
    Best regards,
    Kevin
  • MuthukumaranAX Profile Picture
    MuthukumaranAX 2,901 on at
    Select query for creating Pivot table
    do you want to summarize the data and insert into table or show in report? 
    how do you want to execute the summarization on this table by user action or through periodic job?
  • andreasraithel Profile Picture
    andreasraithel 4,834 Super User 2024 Season 2 on at
    Select query for creating Pivot table
    Hy,
    as the F&O is mostly transcational oriented I would not do this within the ERP instead use any external tool like Excel or PowerBI for this kind of analyze.
     
     
  • Layan Jwei Profile Picture
    Layan Jwei 7,266 Super User 2024 Season 2 on at
    Select query for creating Pivot table
    Hi Teevo,
     
    Can you re-write the tables. I got lost alittle in the first table as there is a field value 'No' but there is no column for it
     
    Also the 2nd table, the labels are close to each other. So if you can please maybe take screenshots from excel (it might be better)
     
    Also what is countAmountCount, how was this filled?
     
    And I didn't understand the question, what do u want to do in x++?

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,466 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans