Posted: September 13, 2022 at 11:57 am
September 13, 2022 at 11:57 am Hi, I discovered this by accident – csv file export without any filters gives one arrangement of columns, but if I turn on a filter like APPROVED puts information in different columns. Seems to be the same over to column AA, but, for example, a question that’s in column AB in over version is in AD in the other and vice versa. AC has the same info in both versions. Samples available on request if this is too confusing. AC is the last of my data, so I don’t know of there would be more changes in a wider dataset. And the sort order is different – one ways is chronological, the other is in reverse chron. Wouldn’t be too hard to fix the different order, but moving columns around to match my report format is tedious and not fun. So is this the intended situation or not? If this is intentional, why??? |
|
Hi Michael, I don’t think this is intentional and I can’t reproduce it currently. Can you send a copy of the 2 reports to support[at]eventespresso.com so I can take a look? |
|
Files are on the way. |
|
Thank you for the CSV reports. I’ve been investigating this and in short the registrations are using the order by for the list table when using the filtered export, that’s REG_ID and then REG_DATE. So if you want the filtered export to follow the order of the unfiltered report, click on the ID column to change the view ao its order ASC and that should export in the same order. I’ve opened a discussion on this as technically what it is doing there is correct, the filtered export applies the current filters active on the page and the order by filter is one a user can change (like doing the above), so when applying the filters is needs to apply that order by field. So far I can’t reproduce the question labels returning in the reverse order but we will have requested some feedback from our senior dev, I suspect is based on the table JOIN used for the filtered exports (it’s a different query to pull in the correct question labels for ‘filtered’ events) but we can’t just apply an order_by there as they should follow the order set in the question groups… which is based on the table join. Tricky, but we are investigating this further. |
|
September 15, 2022 at 10:24 am Ok, that resolves the mystery of sort order, but that’s extremely subtle and un-obvious. Why would the sort be different for different filters? I understand, the software is doing what it’s designed to do, but now my question is why is it designed THAT way? Am I missing some obvious benefit from that logic? By default, looks like when I open registrations for an event, the newest is at the top, but when I export that, the file is newest at the bottom? Is that correct? I’m puzzled by this, but it’s ‘small potatoes’ now that I know the work-around. I never knew that the sort order in the plugin table had an effect on the sort order of a file export. Thanks for listening! |
|
September 15, 2022 at 10:41 am
The filtered view is designed to output the registrations in the same way you are viewing them on the table view template. So when you apply any filter other than the default output it applies all of the filters set. So the default sort order for the table view is REG_ID DESC then REG_DATE DESC, so when you click on the filtered export those parameters are passed to the query so that the CSV outputs what you viewed on the list table. The unfiltered registration view is exporting all of the registrations based on the default values for the registration report, that’s using REG_ID ASC
‘Correct’ as in the code is telling it to do that when filters aren’t applied. Personally, I think I would prefer the default for the CSV report to be DESC so that the ‘latest’ registrations are always first, meaning you don’t need to scroll or sort the CSV to view the newest registrations. I don’t know the reason for choosing REG_ID ASC but have asked as part of the discussion mentioned above.
Relatively recently we combined the 2 registration report buttons into one so that filters apply dynamically if set. They apply in the same way they always have but now you don’t need to click a separate button to do so. I went back to the version prior to that change to check if the above was still true and it is (the row order, not the question label order). |
|
September 15, 2022 at 11:43 am I think understand what you are telling me but there are a few details to ask about. Thanks! |
|
September 15, 2022 at 11:49 am
REG_ID is the Unique numeric ID for each individual registration, it’s the first field shown on the table. ASC is short for ASCENDING, as in 1,2,3,4,5. Vs DESC, the short for DESCENDING, as in 5,4,3,2,1.
REG_ID DESCENDING and REG_DATE DESCENDING It’s used in the query to pull the registrations, they are order by REG_ID descending and the REG_DATE descending.
The fields in the CSV that have reversed are your custom question labels. So the custom questions you have assigned to the event, when pulling those into the CSV and outputting the question label (the text used for the question titles) , the query used is returning them in X order but then when filtered the query changes and its returning the same question labels but in reverse order. Those are the fields that are changing order in your CSV. |
|
September 15, 2022 at 12:01 pm *LOL* All I could think of for ASC was ASCII – my age is showing I guess. Now I understand what that is. Current sort situation isn’t what I could prefer, but it’s a 51/49 kind of preference, so I can live with that. Looking forward to hearing about the column order now. |
|
September 15, 2022 at 12:06 pm Curiosity got the better of me. I went back to a prior event and pulled filtered and unfiltered reports. Column swap still happened, but this time it was AB and AC, not AB & AD. I’ll send the files to that email address. |
|
September 15, 2022 at 12:34 pm The columns that change will change depending on the number of custom registration questions (and which specific questions) you have assigned to the event. 3 custom questions and you’ll have 3 fields in Order X on the unfiltered report but then order Y on the filtered. 5 custom questions and you’ll have 5 fields in Order X on the unfiltered report but then order Y on the filtered. The question field labels used on the titles is changing order based on the query used, it’s the same fields just returned in a different order. |
|
September 15, 2022 at 12:41 pm Ummm, I didn’t follow that – why should the order of columns for custom questions change based on a filter applied to some other stand standard field. I under stand the number and order would change between DIFFERENT events, but I don’t understand why reports would differ in the SAME event. Just when I thought I was understanding, I’m suddenly back down the rabbit hole with Alice. |
|
September 15, 2022 at 12:47 pm They shouldn’t change and I can’t reproduce it on my end, that’s why we are investigating further. The queries used for the unfiltered reports to pull in the question labels are different from the queries used for the filtered reports (because they have to be) and I think the JOIN in the SQL query for those filtered reports is causing the results to be returned in reverse. I was just explaining what is happening on your reports and why the columns that change appear to be different, it’s dependent on your custom questions. |
|
The support post ‘Order of columns in cdv export file changes depending on the filter’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.