on 10-12-2012 3:19 PM
Hi,
I have few Analytical View deployed in my test system. i am able to see the data of few analytical view by executing select statement (with group by clause) using studio.
Example: SELECT CAST(SUM(COL1 as DOUBLE) ) as COL1 , CAST(COL2 as NVARCHAR) as COL2 FROM _SYS_BI.<ANALYTICAL_VIEW> GROUP BY COL1
the same SQL query is throwing me error for the Analytical View containing calculated Attribute or calculated measure.
Please help to understand the SQL syntax to get the data.
Thanks
Hemant
Hi Hemant.
On the analytic view giving you an error can you still run the data preview or is this too not retrieving data? If the data preview is not getting data then you need to review your model. EG review filters etc and warnings on activation. If you cant see data preview information then a select will also not show any data.
Next, If you can see data preview information than I think this may be a syntax issue. EG analytic views and calculated attributes use the OLAP and CALC engines of the HANA database. SQL syntax uses a different engine. If you run a select * statement on your analytic view does it work? If it does, can you see the calculated attribute in the output? If not then you will need to use CE logic to see it I think. Can you confirm on the points above and Ill try to assist further. I think Ive experienced a similar issue as you but I need more information to understand your issue.
My issue was I could not select on the calculated attribute in my stored procedure as the attribute is generated after the select statement so I was not able to get at it with normal SQL. I had to use CE function logic.
Kind regards,
Danielle
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Hemant,
I do not know of such a location in HANA that holds a global list. You will only be able to see which calc attributes/measures you can call from a view in the output of the analytic view itself. EG on the right side of the model make sure you see the output of the fields you are calling in your SQL.
Can you run a SELECT * FROM ? Your From needs to be in the following format "_SYS_BIC"."package.subpackage/ANALYTIC_VIEW_NAME"
General syntax below.
SQL Syntax 1: | CONVERT( datatype, expression [, style] ) | |
SQL Syntax 2: | CAST( expression AS datatype ) | |
Parameters: | expression Any expression of any type. datatype
style
| |
Escape Syntax: | {fn CONVERT( expression, datatype )} | |
Return Type: | definite with the parameter datatype. |
Examples:
SELECT convert( varchar(30), price )
SELECT convert( nvarchar(30), now(), 102)
SELECT {fn convert( {fn now()}, nvarchar(30))}
SELECT cast( price as varchar(30)
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.