Refs in report causing error

I have the following expression in a report template. Itโ€™s causing an error, but I donโ€™t know what it is because it gets cut off in the log and I canโ€™t see the whole message. Is it because Iโ€™m trying to reference a reference? If so, how do I get to that data? I basically need to look at a field (date) within a referenced table (Level โ€œXโ€ Assessment) of a referenced table (trainees, whose key value is โ€œRandomIDโ€) . Here is the expression:

Last Assessment: <<ifs([RandomID].[Current Level]=1,[RandomID].[Level 1 Assessment].[date],[RandomID].[Current Level]=2,[RandomID].[Level 2 Assessment].[date],[RandomID].[Current Level]=3,[RandomID].[Level 3 Assessment].[date])>>

It is also worth mentioning that not every trainee is going to have an assessment in existence for each Level. This doesnโ€™t present a problem within the app, because it just doesnโ€™t show us a link to the โ€œbadโ€ ref (the table is ready-only so the detail view only shows the โ€œactiveโ€ refs)โ€ฆ Just in case this presents a problem in this situation?

Solved Solved
0 6 149
1 ACCEPTED SOLUTION

Yep, the problem is the dereference chain.

View solution in original post

6 REPLIES 6

Steve
Platinum 4
Platinum 4

Please post a screenshot of the error.

Quite possible. Dereference chains (e.g., [RandomID].[Level 1 Assessment].[date]) are not (yet?) supported.

Urgh. I really need to be able to โ€œreferenceโ€ two levels deepโ€ฆ This is going to be a big issue with my app.

At any rate, hereโ€™s the error verbatim (I figured out if I highlight it will scroll even though thereโ€™s no scrollbar)โ€ฆ Seems it may be the โ€œreference to a referenceโ€, but the message is clear as mud.

โ€œErrorsโ€: โ€œError: Report โ€˜TT report -Weeklyโ€™ action โ€˜Action 1โ€™ Body template. Expression โ€˜ifs([RandomID].[Current Level]=1,[RandomID].[Level 1 Assessment].[date],[RandomID].[Current Level]=2,[RandomID].[Level 2 Assessment].[date],[RandomID].[Current Level]=3,[RandomID].[Level 3 Assessment].[date])โ€™ is invalid due to: Error in expression โ€˜[RandomID].[Level 1 Assessment].[date]โ€™ : Unable to find column โ€˜RandomID].[Level 1 Assessmentโ€™.โ€,

Yep, the problem is the dereference chain.

I actually just figured out a way to โ€œcode around the problemโ€! Thanks for your help.

Care to share?

Sure. I ran the portion through a select() so that I didnโ€™t have to ref two levels โ€œdeepโ€.

Top Labels in this Space