Exporting summarised instances

8 posts / 0 new
Last post
VITOPIEPOLI
Offline
Joined: 10/29/2019 - 11:28
Exporting summarised instances

Good morning,
I have a summarisation report with 54 records each of those has a number of instances that renges from few thousands to more than two millions.
Now, what I need to do is to export each row in a separate csv or txt file that will be sent to the relevant audit unit.
Is there any script that could help me in having typefile needed and automate the export  process? 
Those 54 entities could become more than 100 at the end of the year and I need to automated the process.
Thank you very much for your help.
Vito

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hello Vitopiepoli,

When you are talking about exporting are you talking about exporting the transactions?  So for the item that has two million transactions you would like to create a separate file and then save as a CSV?

I don't know of any scripts that would do this but I think one could be built fairly easily.  First step would be to use key value extraction to break-up the main file into its separate components.  The key value extraction has a limit of 500 items but since your is less than 100 there wouldn't be a problem.   Next step is to have a loop to export the files into a csv file.  Is this what you are looking for?

VITOPIEPOLI
Offline
Joined: 10/29/2019 - 11:28

Hi Brian,
Yes you are correct on both points:
1) I would like to have a separate csv file for each row
2) I was just thinking about a recursive use of extractions from the summarised files but I am not sure how to get the data that actually makes it. I would like to use a "for i in .... then" type of function with ith being the name of entity the data are summarised over. Or if it is easier to run the "for i in ... then" for all the entities in the "entity name" field.
I am not so familiar with programming yet and less of all with Ideascripting.

klmi
Offline
Joined: 02/13/2019 - 08:41

Hi Vito,
is your question in conjunction with the data you posted here: http://ideascripting.com/forum/importing-messy-txt-data?

VITOPIEPOLI
Offline
Joined: 10/29/2019 - 11:28

Hi klmi,
In a way. I figured out how to import it correcly and now I am working with it.
Why?

klmi
Offline
Joined: 02/13/2019 - 08:41

Why? Only to have a better idea what you are doing.
That means when you summarize that data by client / client ID with IDEA as a result you will find one row to each client / client ID, the number of items and the summed up amount.
Do you want to export only that single line for each client / client ID with the related amount OR do you need all the bookings per client / client ID? 

VITOPIEPOLI
Offline
Joined: 10/29/2019 - 11:28

Hi Klmi,
Thanks for your reply, Brin's script worked well.
Regards

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi Vitopiepoli,

I put together a script for you.  It will break a file into its records based on a character field and then save each of those files to a csv file.  I think this is what you are looking for.