Skip to main content

Drop-down box

Hi everyone,
Can you please help me vb macro in idea
I have direct extraction equation below
@match(columnname,1000) and.columnname < 0
Where in scripting I need to change the column name by selecting drop-down and account numbers were changing Case by case so I need input different account numbers.
 
Please help me in this regard how to write macro for this.  
Thanks in advance 
Nagaraj Arali
 
 

Brian Element Sun, 07/09/2017 - 14:20

Hi Nagaraj and welcome to the site.

Here is an example that you can work with.  I changed your equation for an "or" instead of an "and" as if you want items less than zero and also items equal to 1,000 you will never have a match, an "or" gives you all negative amounts and items equaling zero, if that wasn't what you want you can change the equation accordingly.

Also I have some videos that might help you out as they do something similar to what you were trying to do above.

http://ideascripting.com/content/ideascript-tutorial-intro

Brian

Nagaraj Arali Mon, 07/10/2017 - 03:02

Thank u so much for your help
Sorry for the confusion 
First column is to extract account number I.e 1000,2110 etc. And second column is amount that should be Less than 0. Eventually I need amount less than 0 in the both account numbers.
Here in each case account column,amount column and account number are changing.
Everycase I need select columns from the drop-down which are as per database and need to input account nubers as required to extract
I need script to select Column based on requirement and inputbox to input account number.
Could you please help me in this regard
Thank you

Brian Element Mon, 07/10/2017 - 17:46

Ok, here is an update.  Right now the equation has been set-up so that the match is on a numeric field, if it is character field then the equation needs to be adjusted.

 

Nagaraj Arali Tue, 07/11/2017 - 12:01

Thank you Brian, 
Based your suggestions I have created 3 different script by making little bit changes by adding additional string based on requirement.
Now I need to join all 3 and run one by one using single key... I am familiar with Excel script, but I am new to idea script 
Could you please help me in this
Thank you

Nagaraj Arali Tue, 07/11/2017 - 15:03

Thank you Brian, 
Based your suggestions I have created 3 different script by making little bit changes by adding additional string based on requirement.
Now I need to join all 3 and run one by one using single key... I am familiar with Excel script, but I am new to idea script..
Could you please help me in this
Thank you

Nagaraj Arali Tue, 07/11/2017 - 15:15

Thank you once again....
If account field having mix of characters and numeric both (ex. In index function how it will extract both characters and numbers)...
What I could make changes in scripting..
Could u please explain little bit more about to run 3 scripting one by one.... 
Thanks you for your help

Brian Element Wed, 07/12/2017 - 08:11

In reply to by Nagaraj Arali

Hi Nagaraj,

A field in IDEA can only be character or numeric but it can't be both.  Now you can have numbers in a character field but IDEA will view them as characters and not numbers, that is why you can't do any addition, subtraction, etc with them.

Using the @match function the syntax of the field is different if it is numeric or character.  So an @match for numeric would be in the following format:

@match(MY_FIELD, 10000, 20000, 30000)

If MY_FIELD is character it would be in the following format:

@match(MY_FIELD, "10000", "20000", "30000")

notice that the items you are looking for are surrounded by double quotes for a character field but nothing for a numeric field.

Right now in your equation since you didn't use double quotes I am assuming that your field is numeric, if it is character then you need to add the double quotes. 

Is it possible that you wouldn't know what the field type would be but know what items to look for?  If so what needs to be done is allow the user to select the field and then test if the field is numeric or character and use an equation that corresponds to that selection.

Let me know if the script needs to be modified.

Brian Element Wed, 07/12/2017 - 08:15

In reply to by Nagaraj Arali

In IDEAScript there is a function that allows you to call another script, run the script and return to the first script.  Can you explain what you are looking for.  Sometimes it is easier to have everything in one script depending on what you want.

Nagaraj Arali Wed, 07/12/2017 - 09:29

Thank you
I am extracting required accounts if they are debit once and few accounts if they r credit... Both extraction for different account..hence I have created 2 script
Now I need to call both script one by one.
One script named as debit extraction and credit extraction another one
Some time I need to run both,
Instead of opening both script if possible to run one script to run both on the same file