Skip to main content

Sending Results to an IDEA database through IDEA scripting (e.g. Pivot Table)

Hello Everyone
 
I hope you are all well.
 
May you please assist?
 
I was wondering if there is a way to send your Pivot Table results through an IDEA script to an IDEA database, rather than having to go and manually select "Send to IDEA database" after you have created you Pivot table. The creation can be done through a script, its just the turning the results of the Pivot Table into an IDEA database that i dont know how to get around in scripting. 
 
If this has been addressed already in the past topics, please kindly the share a link.
 
Thank you very much, please kindly assist if this is possible.
 
Regards,
Smiso.
 

Smiso Fri, 04/23/2021 - 12:17

Hello
 
I have Just figured it out :). you just need to replace "False" with "True" on  "task.ExportToIDEA".
 
Thank you.
 

Smiso Wed, 04/28/2021 - 09:45

In reply to by Brian Element

Hi Brian
 
I hope all is well.
 
Thank you for your response hey.
 
Now, I just have one question: Is it possible to delete the "Results" part e.g. Pivot Table, for a particular database? This will ensure that everytime I run a script my Pivot Table database does not change names. Currently everytime I run my script, IDEA detects that there is already a Result with the same name, and then IDEA save the new database with a new name by adding a "1" at the end of the name of the new database. Is it possible to detele results at all? so that I can replace the Pivot Table exported database and my original database name remains, everytime I run my script.
 
Regards,
 
Smiso.

Brian Element Wed, 04/28/2021 - 10:30

In reply to by Smiso

Hi Smiso, unfortunately I don't know of a way and there is no documented way to do it.  Sorry, not the answer you wanted.

Well I asked a coworker and I was proven wrong this is great.  If you look in the language browser there are a few ways to do it:

Database.Delete All Results

Database.DeleteResultbyIndex

Database.DeleteResultByName

So there you go.  You would probably use the DeleteResultByName in your scenario.

Smiso Wed, 04/28/2021 - 10:54

In reply to by Brian Element

Hi Brian
 
Thank you for the prompt response hey.
 
I am currently running this version: 10.1.6.3 (X86 ), i think this is version 10.3, Im not sure, you can confirm for me if I'm correct here.
 
Let me go ahead and try and use the solution above, I will report back if it works :).
 
Regards,
 
Smiso.

Smiso Wed, 04/28/2021 - 11:20

Hi Brian
 
The "DeleteResultByName" solution is not working. I might be doing something wrong here, also Im not sure if its because of my current version, per the above. Just a note, I am not really a systems engineer, I like to automate tasks, for efficiency at work, so, I dont know much about programming. See, the error message on the screenshot.
 
Please see if you can help in any way.
 
Regards,
 
Smiso.

Brian Element Wed, 04/28/2021 - 14:18

In reply to by Smiso

Here is the example code from the language browser:

Sub Main

' Open the database.

Set db = Client.OpenDatabase("Sample-Detailed Sales.IMD")

' Delete the result named MyResult.

db.DeleteResultByName "MyResult"

' Clear the memory.

Set db = Nothing

End Sub