Transpose rows into column to write into excel sheet

Transpose rows into column to write into excel sheet

  

I have a sample table as given below

Id. CustID  year  month.  Time(hrs)

1.    101.    2018. 1.           45

2.    101.   2018.   2.           43

3     102.   2018.   1.           45

4.    102.   2017.   1.           50


 I want to transpose this table as below to write into excel according to each custID

For CustID 101 table  should be like 

Fy-18.       Fy-18

Jan-18.    Feb-18

45.             43

Can I do this with query or any other way?

Pls provide solution.

Hi Monika,

Can you explain exactly where you are stuck in this? And perhaps a bit of background, like how is your "sample table" stored in the database?

Hi Monika,

I don't know exactly what you want to do with your table data, but my intuition is saying that you may need a Pivot.

There's a Forge component for that:

https://www.outsystems.com/forge/1141/

Hope it may help

Hi Monica,

It is just a matter of logic.

You need to iterate the rows coming from your Simple Query and export each row on a column in the excel file and record each field in a row in the Excel file.

You control the rows and columns you want to address in the excel file by integer variables you can manipulate within your logic.

Should you still have any question, share your oml with us and I'm sure someone will come up with a good suggestion.