Script to pass the prompt for first time control total calculation
Forums
Hello!
When using IDEAscript to run a macro to calculate the control total on a specific field, IDEA will prompt the user to accept calculating for the first time. Is there a way to bypass this using a script?
Thank you!
Shawn
I tried to find these command
I tried to find these command but could not.
I creating a macro that inserts a field that uses the field stats function but the field returns ERROR as the fields stats need to be run first.
what cmmand do i inset beofre the creation of the field( and equations) that ensure the fieldstats are run. I am doing a number of extractiosn and then creating the fields in each extraction >
thanks
pat
Hi Pat,
Hi Pat,
Here is some example code. You first access the field you want the stats on, in this case the CREDIT_LIM file and then test to see if the stats have been computed and if it hasn't then compute it.
Brian
Sub Main
' Open the database.
Set db = Client.OpenDatabase("Sample-Customers.IMD")
' Get the field statistics.
Set stats = db.FieldStats("CREDIT_LIM")
' Determines whether the field statistics have been computed.
If stats.Computed Then
MsgBox "The statistics are already computed."
Else
MsgBox "Computing the statistics."
stats.ComputeStats
End If
' Clear the memory.
Set db = Nothing
Set stats = Nothing
End Sub
Hi Shawn, yes there is.
Hi Shawn, yes there is. Unfotunately I just switched jobs and I am still waiting for them to install IDEA on my work computer so I can't look up the exact command. If you go into the help that has all the IDEAScript commands look under fieldstats, there is example code that will check to see if the fieldstats have been generated and if they haven't been generate then there is a command to force the generation of the stats. This will get rid of the user prompt to calculate the field stats.