Microsoft.AnalysisServices.AdomdServer.AdomdException in BIDS - ssas

We are using following MDX to create dynamic named set to generate future dates for one of our cube -
LASTPERIODS(100, STRTOMEMBER("[Calenar].[Calendar Date].&[" +
CSTR(FORMAT(DATEADD("D",100,[Forecast].[Date Recorded].CURRENTMEMBER.MEMBERVALUE),
"yyyy-MM-ddT00:00:00")) +
"]"))
Above query expression executes successfully in MDX Query Analyzer. But after cube is processed successfully, we are facing issue while browsing the cube and getting following error:
Error occurred retrieving name set: Execution of the managed stored
procedure DATEADD failed with following error
'Microsoft::AnalysisServices::AdomdServer::AdomdException
Internal Error : An external component returned an error (HRESULT = ).
The following system error occurred: Type Mismatch
Any help on this will be highly appreciated.
Referenced Link - MDX Named Set Rolling Date Range
Thanks,
Kinjal.

Do you have any null or "non-date" values in the [Forecast].[Date Recorded] members? Does this work when you run it as an MDX query on your cube?

Related

Unable to run contains query

I am unable to run a contains query in my sybase database.
Query:
SELECT *
from party CONTAINS(nm_first,'ghjg')
On running the above query, I get an error message
"Table User-Defined Function 'party' not found" Error: 7306
Is this a bug? I am unable to find enough resources to find appropriate solution.
Any inputs would be appreciated.
You can do this instead
SELECT *
FROM party
WHERE nm_first LIKE '%ghjg%'

SAC hierarchy is not working with an input parameter

I’m seeking your support with SAC hierarchy. It seems not working well when defining an input parameter in calculation view (CV) in hana studio.
Once added input parameter for years to enable users to select a specific year once they open the dashboard.
All hierarchies became not working & showing error as in screenshot.
SAC hierarchy error pic
Errors
Server Error Caught exception : exception 52731: Hierarchy cache error for hierarchy SBU_H : Hierarchy create error for
"_SYS_BIC"."FANAR_REPORTING_PROJECT.SCM.SAC_DATA_MODELS/CV_SCM_DELIVERY_AND_COST_MODEL/SBU_H/hier/SBU_H"
error: SQL: column store error: search table error: [34023]
Instantiation of calculation model failed;exception 306106: Undefined
variable: $$year_scope$$. Variable is marked as required but not
set in the query
I use YEAR_SCOPE input parameter in where statement to reduce the number of fetched records.
As you can see bellow this is the created YEAR_SCOPE.
SQL where statement with YEAR_SCOPE pic
This is how YEAR_SCOPE created
created YEAR_SCOPE in CV hana studio
Here from frontend side (SAC) by default 2019 is the selected value & user can change it as well
SAC frontend with year selection
At the end I’m wondering if there is any way to solve this error...
Thanks in advance!
In order to use input parameters with HANA information views it is required to use the WITH PARAMETERS() syntax.
When the view parameters have been defined as variables then the reporting UI will simply create WHERE conditions with the selection parameters chosen by the user.
Based on the screenshots this is what is happening here.
For SAC to instead use the WITH PARAMETERS syntax the view parameters have to be defined as input parameters and the parameters have to be mapped in SAC.

"An error occurred while extracting the result into a variable of type (DBTYPE_I2)"

I am getting below error in production instance. There were no changes to the ETL and the job was running all OK everyday. Today suddenly it has started failing with error:
Source: SQL Update Audit Table Processing Execute SQL Task Description: Executing the query "UPDATE AuditTableProcessing SET ExtractRowCnt = ?..." failed with the following error: "An error occurred while extracting the result into a variable of type (DBTYPE_I2)"
When I run the job in development environment everything runs smoothly without an issue. Any hints on the issue will be much helpful!
It looks like that there are a Variable Mapped in the ResultSet of the Execute SQL Task is of type DBTYPE_I2 and the value does not fit theis type, try changing it to DBTYPE_I4 or relevant data type.
More information about ResulSet:
SSIS Basics: Using the Execute SQL Task to Generate Result Sets

Finding which function cause the error message while processing a table

by processing (Process Full,Process Data) a table (every table) in my cube, I get the following error:
Failed to save modifications to the server. Error returned: 'A function 'MAX' has been used in a True/False expression that is used as a table filter expression. This is not allowed.
A function 'MAX' has been used in a True/False expression that is used as a table filter expression. This is not allowed.
The credentials provided for the SQL source are invalid. (Source at XXXX;XXXX.). The exception was raised by the IDbCommand interface.
How can I find which function cause this error?
Query the $SYSTEM.MDSCHEMA_MEASURES DMV, which lists measures in a Tabular model. The Expression column contains the definition of each measure, and you can use this to find any measures that have the MAX function that was specified in the error message. SSAS DMVs can either be queried from an MDX query editor window in SSMS or another tool such as Dax Studio. Dax Studio contains a listing of DMVs, and if you don’t already use it I’d recommend looking into this. You here find more information on this here. You can also execute your
measure in Dax Studio, which can help with
debugging it. You will also want to verify that the account you’re using has the proper permissions on the SQL Server objects used by your Tabular model.

RODBC - Passing a data table filter for sqlQuery

I have looked at the following thread and its related links for RODBC help when it comes to passing an argument to sqlQuery: Pass R variable to RODBC's sqlQuery with multiple entries?
I have a function that takes in a year argument as a data table and the function will run smoothly when only one year is used as a filter but not if multiple years are inputted.
What's weird is that the function ran on my PC smoothly using multiple year filter before but now I'm getting the following error when I run it now:
42S02 208 [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'Output'.[RODBC] ERROR: Could not SQLExecDirect 'select * from ##Output'
I have all of my ODBC set up correctly, I think, that's why it runs when sqlQuery is only filtered with one year.
If someone could explain to me any possible reason why the function is not running on a multiple year argument would be great.