Creating a csv with Filtered tables.

Hi,


I have a spreadsheet that has several tables, each with different filters. However when I export the csv files, the filters are ignored and the data that is exported is all of the records in the table instead of the filtered data. Is there a way to create the export from the filter? I don't want to have to go in and delete the records each time as this is a template that will be used daily to create csv files for a data merge and the filters are the key component.


Any advice would be very welcome!


Thanks!

Posted on Jul 20, 2011 8:03 AM

Reply
9 replies

Jul 20, 2011 10:41 AM in response to MKash

I assume that in fact you are using the feature named "Categories".

If I am right, you must use an other scheme to filter your datas. Categories apply only to the way datas are displayed.


Yvan KOENIG (VALLAURIS, France) mercredi 20 juillet 2011 19:41:10

iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8

Please : Search for questions similar to your own before submitting them to the community


To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

Jul 20, 2011 11:03 AM in response to KOENIG Yvan

I guess I don't know what you mean by "Categories". I click on the Header and select more options, then do a filter. I was assuming that was called a filter not a category. Yes it displays what I want, and it exports the whole table and not the filter. I want to be able to export a csv based on the filter and I have no idea where to begin to do this. You say I must use other scheme to filter my data.. please give me some advice on how to do this.


Thanks!

Jul 20, 2011 11:16 AM in response to MKash

I understand why it does it, because technically the rows are still there and when it exports the data it exports all of it. I am only asking how I can get a filter on a table to work that will export as a csv (only the records I want) without having to delete records manually which will take quite a bit of time as this will be a daily process I will have to do. Thanks 🙂

Jul 20, 2011 12:37 PM in response to MKash

OK. I forgot the filter feature available in the Reorganize pane.

It's unable to restrict the range of exported rows.

Here is a way to achieve your goal.


User uploaded file


In Sheet 1 is the main table, the one embedding datas to filter.

In Sheet 2 are two tables in which datas are really filtered.


Back to main table.

In cell D2, the formula is :

=IF(B=TRUE,ROW(),99999)

in cell E2, the formula is :

=IF(ISERROR(FIND("a",A)),99999,ROW())

Apply Fill Down

In every cells of column D embedding a feminine first name, we will get the index of the row.

In others we will get 99999 which is greater than the maximum row index available.

In every cells of column E embedding a first name containing the letter a, we will get the index of the row.

In others we will get 99999 which is greater than the maximum row index available.


In the table "filter #1", every standard cells of column A contain the formula :

=IF(SMALL(Main :: D,ROW()-1)<99999,OFFSET(Main :: $A$1,SMALL(Main :: D,ROW()-1)-1,0),"")

This way we get only feminine firstnames.


In the table "filter #2", every standard cells of column A contain the formula :

=IF(SMALL(Main :: E,ROW()-1)<99999,OFFSET(Main :: $A$1,SMALL(Main :: E,ROW()-1)-1,0),"")

every standard cells of column B contain the formula :

=IF(SMALL(Main :: E,ROW()-1)<99999,OFFSET(Main :: $A$1,SMALL(Main :: E,ROW()-1)-1,1),"")


This way we get only rows with first names containing the letter a.


I guess that you will be able to build your own filters.


This way you will be able to export what you really want.



Yvan KOENIG (VALLAURIS, France) mercredi 20 juillet 2011 21:36:56

iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8

Please : Search for questions similar to your own before submitting them to the community


To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

Jul 20, 2011 7:59 PM in response to KOENIG Yvan

An added note after doing an export from a multi table document:


Numbers still exports all of the rows of your original table, as well as all rows of each of the other tables in the document. As can be seen in this sot of the finder window, each table of the document is saved as a separate file, and all files are placed in a folder with the name you assigned to the export.


User uploaded file

Select and delete the files you don't wish to send.


Regards,

Barry

Jul 21, 2011 1:22 AM in response to Barry

Hello Barry

I carefully designed a two sheets documents.

Are you saying that the export feature can't be restricted to the contents of a single sheet?

If it's that, my memory fooled me.

As I wrote in an other thread, this morning I received 98 mails so I have no time for tests.


Yvan KOENIG (VALLAURIS, France) jeudi 21 juillet 2011 10:22:07

iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8

Please : Search for questions similar to your own before submitting them to the community


To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

Jul 21, 2011 6:45 AM in response to KOENIG Yvan

Hi Yvan,


I never would have thought to do this the way you explained. Thanks so much. It's not exactly working yet, but I think I just need to tweak it and now that I have some direction, I should be all set.


Barry, I actually want the tables exported as whole and then filtered, so Yvan's method works beautifully for what I am doing (when I get it up and running). I was filtering data from another table anyway, so this will be even better, much less rows.


Thanks again Yvan for steering me in the right direction!

Jul 21, 2011 9:12 AM in response to KOENIG Yvan

Hi Yvan,


It's not a feature I've explored enough to say that Export can't be restricted to the contents of a single sheet.


I did do a second test this morning, starting with the same document as before, but moving the two tables onto separate sheets, then selecting Sheet 2 before doing the export. Both sheets (and both tables) are still exported:

User uploaded file


I didn't see any option to restrict the export to only that sheet, nor did I notice any mention of this option in the User Guide article on exporting to a CSV file. Certainly it is (or would be) a useful option. How's it done?






@ MKash:


You wrote: "Barry, I actually want the tables exported as whole and then filtered..."


I must have misinterpreted your previous statements, then:


"However when I export the csv files, the filters are ignored and the data that is exported is all of the records in the table instead of the filtered data. Is there a way to create the export from the filter?"


"I am only asking how I can get a filter on a table to work that will export as a csv (only the records I want) without having to delete records manually which will take quite a bit of time as this will be a daily process I will have to do."


My interpretation of your initial request and of the second version was that you wanted the filtering to be done before the table was exported. That was apparently Yvan's interpretation as well, as that's what his solution does.


My cautionary note, sent after trying an export was that while the filtered tables will be exported, the export will also include the original, unfiltered table(s). As shown in the illustration above, all tables are included (as separate documents) in the export, even if they are on separate sheets. That shouldn't be a major problem, but it is something to be aware of.


Regards,

Barry

Jul 21, 2011 9:51 AM in response to Barry

Hi Barry


As I wrote, sometimes my memory fool me.

After treating my mails, I had a look to the Export feature and clearly I was wrong.

I guess that my memory opened the drawer Print in lieu of the drawer Export.

So


(1) you were right

(2) there is no need to move the tables in a dedicated sheet except maybe if the main table is huge.

As I wrote several times, Numbers behave faster when calculations are done in tables of sheets which aren't at front.


Yvan KOENIG (VALLAURIS, France) jeudi 21 juillet 2011 18:51:36

iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8

Please : Search for questions similar to your own before submitting them to the community


To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Creating a csv with Filtered tables.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.