By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,044 Members | 1,216 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,044 IT Pros & Developers. It's quick & easy.

Sorting data entry against fixed array list

P: 2
I am printing a booklet that has several different funds. These booklets stack the funds related to each record but they must be in a specific order. The problem is that the data does not come in the order that the funds need to be printed.
1) I have a data list of the order in which the funds must print, i.e. 331E, 331F, 192E, 192F, 162E, etc.
These fund numbers do not follow an alphabetical or numerical order, but they have to remain and be retrieved in this order.
2) data spreadsheet does not necessarily come in this order, so I need a script to re-sort it to follow the order of the data list above.
For example, the data comes in this order: 162E, 192E, 331F
I need to pull those funds and set them in order, therefore: 331F, 192E, 162E

Hoping this question makes sense.

Please help!!

I meant to add that I'm not re-sorting the data spreadsheet, I just need the software that I am using to retrieve the data to resort the values for me.

I hope that makes sense.
Feb 21 '15 #1
Share this Question
Share on Google+
3 Replies

Expert Mod 10K+
P: 12,427
I'm struggling to see how this relates to javascript.
Feb 21 '15 #2

P: 2
Yes I suppose I was not more descriptive.

I use a page composition software to create booklets with variable data merged into it, including variable pages that relate to these "funds". The way the 'fund' pages are populated is by way of a data spreadsheet with NAB + the different kinds of funds that people own. Each record has columns (fund1, fund2, fund3, etc) with the different funds they own, for example, 331E, 332E, etc.

These funds have to be put in a particular order. There are for example 30 different fund types and their order is not alphabetical or numerical order. So, the order they have to go in is specific but does not follow a pattern. For example, 331E, 331F, 192E, 192F, 162E, etc. As you see the order in which they fall has no alphabetical or numerical order, but that is the specific order they must be in.

So say Record No 1 owns 3 funds. The data does not necessarily come in the order that they should, for example, 162E, 192E, and 331E. So, I need a script that directs the page composition software to pulls the funds and put them in the order that they need to be in, that is, 331E, 192E, and 162E.

Note: The data folks did not sort their data with the funds in the correct order; and sometimes they do, sometimes they don't. I need to find a way to run this script each time regardless of whether they do or don't.

There is the option of running a javascript script before the booklet is composed. My variables link to the data to pick the funds type (normal process), but before creating the pages, it would sort the incorrect order of the funds into the correct order and then compose the pages.

These funds are 3 pages of information for each fund type that are called to via my variable. So if the data calls for fund 331E, it pulls in the three pages of information for fund 331E.

I was thinking that maybe an array type function would help me with this as in myArray(331E, 331F, 192E, 192F, 162E) and then doing a statement that compares the funds pulled from the data against the array list and re-sort, etc. but I'm not well versed in javascript so I don't really know where I would begin.

Maybe i'm dreaming.

Feb 21 '15 #3

Expert Mod 10K+
P: 12,427
So are having trouble sorting in JavaScript? Or do you know how to sort but not when the data isn't in alphabetical order?
Feb 22 '15 #4

Post your reply

Sign in to post your reply or Sign up for a free account.