South African Public Holidays

12 posts / 0 new
Last post
aveenm293
Offline
Joined: 10/23/2012 - 16:02
South African Public Holidays

Hi There
I need some assistance to write an IDEAScript to identify all transactions that occur on South African Public holidays. The date of the holiday never changes. Ideally the script must allow the user to select the file to test and then column that holds the date. Then the script must run and extract all those records that were processed on the following dates:
 
1 January
21 March
29 March
1 April
27 April
1 May
16 June
17 June
9 August
24 September
16 December
25 December
26 December
Please can someone assist me.
Thank you in advance.
Aveen
 
 

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

Hi Aveen, that sounds like an interesting project.  I will see what I can come up with.

aveenm293
Offline
Joined: 10/23/2012 - 16:02

Hi Brian
Thank you very much.
Regards
Aveen
 

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

Hi Aveen,

Can you try this script out and give me any comments. When you run it you will have the following dialog:

 

Main Menu Dialog

From the above menu you would select the file and the date field.  If you have previously created the dates you can load them in by hitting the Load Dates button.  I have attached a list of all your dates below so you can load those in.  The dates will appear in the bottom of the dialog, you can have up to 24 dates.

If you hit the Edit Dates button you would have the following dialog:

Add Edit Dates

You can add dates in the above dialog or load dates previously saved and edit them.  Also you can add dates and save them for reuse in the future.  The dates must be in the format DDMM and it won't accept Feb 29 as a date.

Let me know if you have any problems or comments with it.  I will probably add it to the scripting section later on.

aveenm293
Offline
Joined: 10/23/2012 - 16:02

Hi Brian
Thank you very much. I will have a look and send you some feedback.
Much appreciated.
Regards
Aveen Mahado
 

aveenm293
Offline
Joined: 10/23/2012 - 16:02

Hi Brian
I tried running the script. When I click load dates I get the following error per the attached file:
Error on line 308.
Also after choosing specific dates, I also get the following error per the attached file:
Error on line 412.
Regards
Aveen
 
 
 
 
 

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

Hi Aveen, I developed this using IDEA V9, I had one of my friends run it last night and they also had problems with V8.5.  So I will reinstall 8.5 and try and figure out what the difference is in the two versions.  I will get back to you.

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

Hi Aveen, I found the problem and have updated the script to work in version 8.5.  It is attached above.  I also added on two other things based on comments from a friend who tried it out last night.  I have added the text file name to the main dialog and also added an option to extract all dates except for those listed.

Let me know if you have any problems or comments on how to imporve the script.

aveenm293
Offline
Joined: 10/23/2012 - 16:02

Hi Brian
I have downloaded the updated script and it works like a dream. A quick question I am currently running IDEA V8.5 - do you know where I will be able to download V9 or at least download a demo version?
Thank you
Regards
Aveen
 
 

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

I think you will have to talk to your distributor about the updates and/or a demo version.  If you watch the videos that are online they were all done with V9 so that can give you an idea of what it looks like.

Great to hear that the script works!!  It would always be interesting if you want to talk about how you are using the script in real scenario.

SeanElrington
Offline
Joined: 03/21/2013 - 16:55

Brian, your scripting information is really helpful and  the videos are excellent.
Please keep adding more scripting videos e.g. how IDEAScript and VisualScript can work together, or how/why to create an executable.
Scripting is not that well documentated in IDEA so every little bit of info helps, particularly about the bugs.

Pages