Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

create a report

nkrupabd
8 - Asteroid

Hi,

I'm trying to create a report of the following format. 

Could someone please help me with this

11 REPLIES 11
saveeshkumar
9 - Comet

@nkrupabd 
could you please present more information on the request.

nkrupabd
8 - Asteroid

I want to present the data in the specific format only(the format attached above)

saveeshkumar
9 - Comet

@nkrupabd 

 

I have used python tool and xlsxwriter package to render the report in same format.

please find the sample code to above format.

 

saveeshkumar_0-1643633398903.png

 

 

nkrupabd
8 - Asteroid

Thank you , But unable to open the workflow can you please send a screen shot, it might be helpful.

saveeshkumar
9 - Comet

Hi @nkrupabd ,

 

saveeshkumar_0-1643634480353.png

 

 

Please find python code.

 

 

 

from ayx import Alteryx
import xlsxwriter
import pandas as pd
df=Alteryx.read("#1")
print(df)
workbook = xlsxwriter.Workbook('C:\\Community\\Example3.xlsx')
worksheet = workbook.add_worksheet("sheet")
#Line 2
Line1 = (12345678,'Krupabdhi','havish','SZZ1','1/31/2022','E346222770',42,50.02)
row = 1
col = 1

# Iterate over the data and write it out row by row.
for d in (Line1):
#worksheet.write(row, col, df[index])
worksheet.write(row, col, d,cell_border)

col += 1
#Line 5
cell_format = workbook.add_format({'bold': True,'border': 1})
cell_border = workbook.add_format({'border': 1})
Line5 = (['Old Rate',42],['Start Date','12/1/2021'],['End Date','12/5/2021'])
row = 5
col = 3

# Iterate over the data and write it out row by row.
for header,value in (Line5):
#worksheet.write(row, col, df[index])
worksheet.write(row, col, header,cell_format)
worksheet.write(row+1, col, value,cell_border)
#worksheet.write(row+1, col+1, value)

col += 1

 

#line 9

Line9 = (['Date','Wed 01/12'],['Schedule',''],['Pay Code','Sickness Lv'],['Amount',0])
row = 9
col = 5
for header,value in (Line9):
#worksheet.write(row, col, df[index])
worksheet.write(row, col, header,cell_format)
worksheet.write(row+1, col, value,cell_border)
#worksheet.write(row+1, col+1, value)

col += 1


workbook.close()

 

Thanks

nkrupabd
8 - Asteroid

Thanks a lot .

nkrupabd
8 - Asteroid

Hi here the code is generalized to one employee , if we have 10k employees it's not possible to give the details of employees individually.

Please can you suggest if there is any other way.

Thank you

saveeshkumar
9 - Comet

Hi @nkrupabd ,

 

could you please provide sample data and output..

nkrupabd
8 - Asteroid

Attaching the example input and output.

For every employee based on the name we need to create the output in the format given and each employee needs to be recorded in a different sheet as in the example Dummy_output.

Thank you

Labels