Moโ reports, moโ problems. I have a report that uses a few ifs statements. Most of the time, for some reason, the last bit doesnโt appear in the resulting report at all, not sure why. Hereโs the template for the whole section:
Assessment Status:
Last Assessment: <<ifs([Current Level]=1,[Level 1 Assessment].[date],[Current Level]=2,[Level 2 Assessment].[date],[Current Level]=3,[Level 3 Assessment].[date])>>
Next Assessment Due: <<ifs
(and([Current Level]=1,isblank([Last Assessment Date])),[Program Start Date]+30,
and([Current Level]=2,isblank([Last Assessment Date])),[L1 Assessment Linked].[date]+62,
and([Current Level]=3,isblank([Last Assessment Date])),[L2 Assessment Linked].[date]+62,
True,
[Last Assessment Date]+62
)>>
Date Scheduled: <<[Actual Scheduled Date]>> <<if: OR([Actual Scheduled Date]<[Last Assessment Date],[Actual Scheduled Date]<today())>>
Please schedule a new assessment date in the TTS system or contact your areaโs Trainer.<<endif>>
The last section that starts with โDate Scheduledโ is sometimes missing from the report entirely, and it should at least say โDate Scheduled: (whatever the date is)โ. Do I need an endifs in there somewhere? There is an endif at the very end, it just wonโt show up on my post. I havenโt found any documentation on using ifs in a template. Other than that, it works a dream. Thanks!
Solved! Go to Solution.
My understanding (which may be incomplete) is that template tags may not be split across lines; i.e., the tagโs <<
and >>
must be on the same line. That makes long expressions ugly and difficult to read, but I believe it is a requirement.
Assessment Status:
Last Assessment: <<ifs([Current Level]=1,[Level 1 Assessment].[date],[Current Level]=2,[Level 2 Assessment].[date],[Current Level]=3,[Level 3 Assessment].[date])>>
Next Assessment Due: <<ifs(and([Current Level]=1,isblank([Last Assessment Date])),[Program Start Date]+30, and([Current Level]=2,isblank([Last Assessment Date])),[L1 Assessment Linked].[date]+62, and([Current Level]=3,isblank([Last Assessment Date])),[L2 Assessment Linked].[date]+62, True, [Last Assessment Date]+62)>>
Date Scheduled: <<[Actual Scheduled Date]>> <<if: OR([Actual Scheduled Date]<[Last Assessment Date],[Actual Scheduled Date]<today())>>
Please schedule a new assessment date in the TTS system or contact your areaโs Trainer.<<endif>>
It is likely syntax that is causing a problem - e.g. a misplaced โ)โ or some such thing.
First, I would make sure that ALL of your pasted text is appearing in the post. You can do this by using the โblockโ feature (for lack of knowing what its really called). This is just 3 back quotes before the text and 3 backquotes after the text. Back quote is the one under the โ~โ (tilda) symbol in the upper left hand side of the keyboard
This is blocked text
It keeps proper formatting and characters such as <<a variable>>
See the image to see what it looks like before posting!
This is the image below
I have taken a deep look and assuming everything in the post is as in the template except for the <<EndIf>>
not appearing at the end, I see nothing wrong with the syntax.
I donโt know for sure if IFS() is supported but expression are and I would think the parser would parse the IFS() function like any other function. You would not need an <<End If>>
for the IFS().
Based on this comment I take that sometimes you DO get the last message? If so then I would take a close look at the differences between those cases that do work versus those that donโt. Maybe some data value is tripping it up?
Also to rule out any kind of parser problem, I would insert a space before and after the โ<โ (less than) or โ>โ (greater than) symbols. My thought is maybe the parser is incorrectly reading them. A stretch I know but stranger things have happened.
My understanding (which may be incomplete) is that template tags may not be split across lines; i.e., the tagโs <<
and >>
must be on the same line. That makes long expressions ugly and difficult to read, but I believe it is a requirement.
Assessment Status:
Last Assessment: <<ifs([Current Level]=1,[Level 1 Assessment].[date],[Current Level]=2,[Level 2 Assessment].[date],[Current Level]=3,[Level 3 Assessment].[date])>>
Next Assessment Due: <<ifs(and([Current Level]=1,isblank([Last Assessment Date])),[Program Start Date]+30, and([Current Level]=2,isblank([Last Assessment Date])),[L1 Assessment Linked].[date]+62, and([Current Level]=3,isblank([Last Assessment Date])),[L2 Assessment Linked].[date]+62, True, [Last Assessment Date]+62)>>
Date Scheduled: <<[Actual Scheduled Date]>> <<if: OR([Actual Scheduled Date]<[Last Assessment Date],[Actual Scheduled Date]<today())>>
Please schedule a new assessment date in the TTS system or contact your areaโs Trainer.<<endif>>
Very good to know!
And just to be clear, by โsame lineโ it is meant a line with no line breaks in the form of return, new lines, etc. Line wrapping, which many editors will do, IS okay? Is that right?
Correct.
If the โline-wrappingโ is merely done on-screen rather than scrolling, yes, thatโs fine. If you can toggle line-wrap off and you then need to scroll to the side to see rest of the line, youโre golden.
Steveโs advice about eliminating unnecessary carriage returns from the code was the solution.
User | Count |
---|---|
40 | |
34 | |
28 | |
23 | |
18 |