Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 72043

AX 2009 Table Rows to Columns for text export

$
0
0

I'm not sure how to go about this. I have a table such as the one below.

 

EmplIDPayTypePayHours
1111A17
1111B32
9898A5
6759B7

 

I need to end up like this in csv format:

EmplID,APayHours,BPayHours
1111,17,32
9898,5,
6759, ,7

 

I already have all the code I need to just do a straight-forward, one line per type/hour. This is an abbreviated version, but you get the idea. I select into a tmpTable.

If (irrelevant criteria)

{

while select EmplID, PayType, sum(Hours) from TableA
                group by EmplName, PayType

{
      this.doInsertTmp(TableA.EmplId,TableA.PayCostType,TableA.Hours);
            }
  }

(there is a lovely "else" statement).

 

Then I pop it into a text file. All of that is working fine, even if my abbreviated sample looks weird.

 while select tmpTableA
  io.write

         (    tmpTableA.EmplID,

tmpTableA.PayCostType,

tmpTableA.Hours 

          );

 

I just need to figure out how to do the calculation that I need to do. I'm banging my head against the wall here. Thanks all.
               


Viewing all articles
Browse latest Browse all 72043

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>