Skip to main content

IDEAScript Questions

Obtaining data from drop down combo box

Hey Brian,
This site has become a staple for me. Thanks so much for all your assistance.
I am trying to obtain the selection from a drop down combo box; however, when I select COL1 where the data is to be tested - nothing happens. When I select COL2 then the script continues and completes my test using the COL1 information. Any idea how to fix this or why it is happening?
This is a copy of the code that I am using to obtain the drop down combo box selection.
If dlg.DropListBox1 > 1 Then
userSel = ListBox1$(dlg.DropListBox1)
Else

User determine column to test extraction

Hi Brian,
Is it possible for the user to enter the column to be tested and the extraction to use the user defined variable instead of hardcoding a column which will need to changed every extraction?
colNum = InputBox("Enter column to be tested (Col1, Col2, Col3 etc...)")
task.AddExtraction dbName, "", "@Isini(""Oper"", colNum)"
These are the two lines specifically. I tried to do it and it shows "Bad equation provided"; however, if i type Col1 instead of colNum, then it works.
Any ideas?
Thanks!

Date range vis a vis missing record in transaction table

Hi Brian,
I have two files. 
1. Stay database- which gives the date range for a particular record. For Eg:- Mr.A has stayed from 1st April 2017 to 4th April 2017.
2. Transaction database- This has the list of charges posted for each customer. So in this i would have day wise charges posted for Mr.A
Now i want to compare whether for every day stayed i.e. 1st April, 2nd April, 3rd April and 4th April the charges have got posted in transaction database or not.
How best can i do this using a script?

Script for pivot table

Hi Brian,
i created a script for pivot table results.
1.  I dont want the subtotals to appear in the pivot. Is there a way to include this in the script itself? Right now i need to manually right click and give remove field.
2. I may run the script multiple times over a period. I do not want a new pivot table result to be created everytime but it should be replacing the existing one. But this is not happening.
 
Could you please help.
 
Regards
Padma T

script for extracting transactions on a particular day

Hi Brian,
I am trying to do a script to extract all transactions on saturdays and sundays. 
When i go to field statistics i am able to see this and extract as well. But it doesnt get generated as a script. Also i am not able to find any idea function which can workaround.
How to go about?
 
Regards
Padma

Replace words in txt file

I am working in a script that open an txt file and replace any caracter that I choose for another one, so far everything is ok.
The problem is when the file that I am reading contains quote marks(") as at example attached(input.txt).
In this case, when the script faces one line that contains a simple quote mark in the middle is enough for the program launch an error message to the user (image attached). 

Checking for consequtive number within a group

Hi,
I am trying to write a script to find out the consquetive invoices of a vendor from vendor ledger.
Input  (Consequtive check is a computed field)

Vendor number
Invoice no
Amt
Consequtive check

1
123
10
Start

1
124
20
Yes

1
125
30
Yes

1
301
400
No

1
302
200
End

2
2134
7000
Start

3
6162
100
Start

3
6163
100
Yes