Error Filtering on Calculated Field

Stephen Johnson shared this question 6 years ago
Answered

Brand new to Yellowfin and trying to learn the ropes.

My database (SQL Server) has an integer field called ldate that stores dates in the format yyyyMMdd. I've pulled this field into a view and then added a calculated field that converts this integer to a date string using the function convert(varchar(8), ldate). I then used the Convert 'Text to SQL Date' option on the calculated field to get a proper date. Then I set up a filter on this new, calculated date.

When I built a dashboard and tried to use the date filter I get the following error:

Error retrieving results

Invalid column name 'ldate'.

UPDATE: If I add ldate as a column on my report table, then the filter works. The problem is that I want my table to aggregate data across the entire filter date range and not display any dates in the result table.

UPDATE: If I replace the filter on the calculated field with a filter on ldate, then I get the table data to aggregate in the way that I want, but now my filter is prompting the user for integers, rather than presenting a date picker.

UPDATE: I was able to get where I wanted by adding ldate as a column, then adding a grouping rule that would force all of them into a single group, then I hid the column on the table view. This allows the calculated date field filter to function and still aggregates all the data in the selected date range. This feels like a hack though and I would welcome anyone who can tell me a more proper way of doing it.

Replies (3)

photo
1

Is there any way to see the SQL it's trying to run that generates the error?

photo
1

Hi Stephen,

yes, you should be able to see the SQL query by changing your logging level from INFO to DEBUG as described in the following knowledge base article:

https://community.yellowfinbi.com/knowledge-base/article/how-do-i-turn-on-debug-logging-within-yellowfin-log-file


and then hopefully the last SQL query in the debug log before the error is thrown will be the one you are looking for.

regards,

David

photo
1

Hi Stephen,

just wondering how you got on with this issue?

regards,

David

photo
1

I have an idea logged that the dynamic table inclusion logic should examine calculated fields. Once that is implemented, this will be resolved. In the meantime, I have to include fields not relevant to my report in order to trick Yellowfin into including the tables that my calculated fields need so that it doesn't generate errors.

photo
1

yes I remember that Idea - it sounded like a good one to me.


regards,


David

photo
Leave a Comment
 
Attach a file