Drop-down box

13 posts / 0 new
Last post
Nagaraj Arali
Offline
Joined: 07/09/2017 - 05:58
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's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

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
Offline
Joined: 07/09/2017 - 05:58

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's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

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
Offline
Joined: 07/09/2017 - 05:58

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

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

Hi Nagaraj, you migth want to check out this thread.  If it doesn't help you out let me know and I will give you a hand.

http://ideascripting.com/forum/call-script-within-script

Brian

Nagaraj Arali
Offline
Joined: 07/09/2017 - 05:58

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
Offline
Joined: 07/09/2017 - 05:58

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's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

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's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

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
Offline
Joined: 07/09/2017 - 05:58

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

Pages