Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Simple Javascript help to put IF statement in report header
Leom
<p>I do not know Javascript very well .. and I need some help putting an IF statement into the header</p><p>of my report.</p><p> </p><p>Currently it reads like this ....</p><p> </p><p>Report for <VALUE-OF>row["Sales Code"]</VALUE-OF></p><p> </p><p>But I need it to evaluate if the user selects "ALL salescodes" </p><p>something like this .. but I cannot get it to work (syntax?)</p><p> </p><p> </p><p>IF</p><p> </p><p>rpSalesCode = 'ALL'</p><p> </p><p>Report is for All Sales Codes</p><p> </p><p>else</p><p> </p><p>Report for <VALUE-OF>row["Sales Code"]</VALUE-OF></p>
Find more posts tagged with
Comments
SyN
<p>Hi Leom,</p><p> </p><p>here is a little example you can put into a <em>Dynamic Text</em>-Field:</p><pre class="_prettyXprint _lang-js">if (params["testparam"].value == "test") {"Test"}else {"nope"}</pre><p>I tried it with a Parameter called "testparam". What type of parameter is rpSalesCode?</p><p> </p><p>Regards,</p><p> </p><p>Marcus</p>
Leom
<p>perfect. THank you.</p>
SyN
<p>You're welcome.
</p>