IBM / paxapi

This repository hosts the API documentation for IBM Planning Analytics for Microsoft Excel. For full product documentation, please visit the Knowledge Center:
https://www.ibm.com/support/knowledgecenter/SSD29G_2.0.0/kc_gen/com.ibm.swg.ba.cognos.ipa.doc_using_planning_analytics_toc-gen2.html
Apache License 2.0
6 stars 5 forks source link

CreateFromCVS for Exploration/QuickReports #48

Open cedarwells opened 2 years ago

cedarwells commented 2 years ago

Running CreateFromCVS returns error - "the given key was not present in the dictionary". The JSON making up the CVS is formatted in {"MDX":"SELECT ...."} and is a string. Does the JSON need to be encoded? I have tried running different CVS JSON strings from different cubes - some using a Meta object, but they each return the same error. Note that I am able to run other PAX API commands without issue. I am running on 2.0.70.4.

tedphillips commented 2 years ago

can you provide a slightly more complete/representative sample of the common view spec you're trying to create from?

cedarwells commented 2 years ago

By way of example:TM1

Dim sMDX As String, sCVS As String, sUrl As String, sInstance As String

sUrl = "https://....." sInstance = "MyInstanceName"

sMDX = "SELECT [}ClientProperties].[}ClientProperties].MEMBERS DIMENSION PROPERTIES MEMBER_UNIQUE_NAME, MEMBER_NAME, MEMBER_CAPTION, LEVEL_NUMBER, CHILDREN_CARDINALITY ON 0, TM1SubsetToSet([}Clients].[}Clients], ""All Members"") DIMENSION PROPERTIES MEMBER_UNIQUE_NAME, MEMBER_NAME, MEMBER_CAPTION, LEVEL_NUMBER, CHILDREN_CARDINALITY ON 1 FROM [}ClientProperties]" sCVS = "{" & CHR(34) & "MDX" & CHR(34) & ":" & CHR(34) & sMDX & CHR(34) & "}"

' WORKS Call Reporting.Explorations.CreateFromMDX(sUrl, sInstance, sMDX)

' FAILS Call Reporting.Explorations.CreateFromCVS(sUrl, sInstance, sCVS, True)

tedphillips commented 2 years ago

ok, there's no meta portion in your CVS. could be we have a bug there. is there a support case?

cedarwells commented 2 years ago

I have tried the CVS with various alterations including the Meta object - with Meta as null or {} and also with Meta objects Aliases, ExpandAboves, ContextSets as {} or null. Perhaps you could advise what is expected. I had wondered if this required encoding?

tedphillips commented 1 year ago

it should be a string value of valid json, who's MDX string is valid mdx, and meta is a valid json object (if it exists).

it's possible to use the schema on the site https://ibm.github.io/paxapi/#common-view-specification-schema to validate the structural content of the CVS string value with regards to json notation (it won't validate the mdx, of course).