on 06-27-2015 7:40 AM
Hi,
I'm trying to use the SQL Script CV in another Graphical CV but facing some errors on the SQL. I've used the SQL Script CV (Ranking calculation) as one of my projection view in the grap cv. I'm unable to do a simple data preview on the projection view. It returns me the below error when I select on Raw Data.
Error: SAP DBTech JDBC: [257]: sql syntax error: [257] sql syntax error: incorrect syntax near "AS": line 1 col 468 (at pos 468)Please check lines: 4,
This is the generated SQL and the input parameters are mapped from Grap Cv to the Script CV.
SELECT TOP 200 * FROM "_SYS_BIC"."PROJECT1/VOL_RANK/dp/Projection_vol" ('PLACEHOLDER' = ('$$IP_COMP_ID$$', '4000'), 'PLACEHOLDER' = ('$$IP_MONTH$$', '3'), 'PLACEHOLDER' = ('$$IP_YEAR$$', '2015'))
However, I've no problem viewing the result directly from the SQL Script CV.
My simply code for SQL Script CV as below.
BEGIN
var_out = SELECT "YEAR_INT", "MONTH_INT", "COMP_ID", "COMP_TXT","RANK", "VOL_SUM"
FROM (
SELECT "YEAR_INT", "MONTH_INT", "COMP_ID", "COMP_TXT",
dense_rank() over ( order by SUM("VOL") desc) AS "RANK",
SUM("VOL") AS "VOL_SUM"
FROM"_SYS_BIC"."PROJECT1/CA_VOL"
WHERE "YEAR_INT" = IP_YEAR AND "MONTH_INT" = IP_MONTH AND "COMP_ID" = IP_COMP_ID
GROUP BY "YEAR_INT", "MONTH_INT", "COMP_ID", "COMP_TXT",
ORDER BY "RANK")
WHERE RANK <= 5;
END
Hopefully someone could shed some lights if there's anything I missed out or whether this is a good approach.
Thanks in advance.
Found the problem. Closing this thread.
Its due to the parameters case sensitive settings for the scripted Calc view.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.