Forum

This content is now out of date.

Visit Our Community

FROM keyword not found where expected

Hi All,

We encountered an error creating view using this query:

SELECT
sum("WTB_ACTIVE_ONLINE_V"."TOTAL_ACTIVE"),
TRIM( TO_CHAR("WTB_ACTIVE_ONLINE_V"."CURR_DATE_TIME", 'HH24'))
FROM "WT_REPO"."WTB_ACTIVE_ONLINE_V"
group by TRIM( TO_CHAR("WTB_ACTIVE_ONLINE_V"."CURR_DATE_TIME", 'HH24'))

We tried to query it on the Database and it was successful and has no errors.

Scenario:
Forum image


If TOTAL_ACTIVE is not SUM then the output goes up. See Screen shots below.

Forum image


We're using an Oracle Database.

What can we do to solve this issue?

May we have the answer as soon as possible.

Thanks and Regards,
Albert
Hi Albert,

The query you are using to create the view may be fine, though when you use this query in the view editor, Yellowfin actually uses this query slightly different.

Could you please click on the 'SQL Syntax' to see the actual query that is being run, and then run that query against your database.

Let me know how you go.

Regards,
David
Hi David,

This is the actual query that is being run:

SELECT DISTINCT
SUM("WTB_ACTIVE_ONLINE_V"."TOTAL_ACTIVE"),
CAST( TO_CHAR("WTB_ACTIVE_ONLINE_V"."CURR_DATE_TIME", 'HH24') AS INT )
FROM "WT_REPO"."WTB_ACTIVE_ONLINE_V"


And this was the result on the DATABASE:
not a single-group group function

maybe YF can't group the values, it will run if we add group by statement.
Please see the Script Below:

SELECT DISTINCT
SUM("WTB_ACTIVE_ONLINE_V"."TOTAL_ACTIVE"),
CAST( TO_CHAR("WTB_ACTIVE_ONLINE_V"."CURR_DATE_TIME", 'HH24') AS INT )
FROM "WT_REPO"."WTB_ACTIVE_ONLINE_V"
Group by CAST( TO_CHAR("WTB_ACTIVE_ONLINE_V"."CURR_DATE_TIME", 'HH24') AS INT )

Is this a Yellowfin issue? Or we just have to configure something?

Thanks,
Albert

Hi Albert,

This is a Yellowfin issue.
We have tested this in Oracle and reproduced this issue.
It seems the query is not being generated correctly when using the calculated field, I've created a support task for this (TASK = 101936).

For now you will have to use the 'group by' statement as a work-around.

We will let you know once it has been implemented in a build.

Regards,
David