<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic TRACE - directly enter an expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/TRACE-directly-enter-an-expression/m-p/777131#M662305</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there any way I can make the TRACE command put in the log the result of an expression without first putting this into a variable?&lt;/P&gt;&lt;P&gt;I have tried with like&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt; $(=Weekday(Today(0))) &amp;lt;&amp;lt;&lt;/P&gt;&lt;P&gt;the way you do in set_expressions, but that didn't work.&lt;/P&gt;&lt;P&gt;I also tried with quotes around the whole, but that didn't work either - then it read like&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt; TRACE ' '; &amp;lt;&amp;lt;&lt;/P&gt;&lt;P&gt;in the log, which isn't quite what I want ...&lt;/P&gt;&lt;P&gt;That didn't work, however. I then created a variable first and then put this into the TRACE command, like&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;nbsp; LET v_message = Weekday(Today(0)); &amp;lt;&amp;lt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt; TRACE $(v_message); &amp;lt;&amp;lt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt; LET v_message = NULL(); &amp;lt;&amp;lt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That works. That is okay, but it should be possible to use this expression directly, no?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Feb 2015 08:21:58 GMT</pubDate>
    <dc:creator>datanibbler</dc:creator>
    <dc:date>2015-02-24T08:21:58Z</dc:date>
    <item>
      <title>TRACE - directly enter an expression</title>
      <link>https://community.qlik.com/t5/QlikView/TRACE-directly-enter-an-expression/m-p/777131#M662305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there any way I can make the TRACE command put in the log the result of an expression without first putting this into a variable?&lt;/P&gt;&lt;P&gt;I have tried with like&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt; $(=Weekday(Today(0))) &amp;lt;&amp;lt;&lt;/P&gt;&lt;P&gt;the way you do in set_expressions, but that didn't work.&lt;/P&gt;&lt;P&gt;I also tried with quotes around the whole, but that didn't work either - then it read like&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt; TRACE ' '; &amp;lt;&amp;lt;&lt;/P&gt;&lt;P&gt;in the log, which isn't quite what I want ...&lt;/P&gt;&lt;P&gt;That didn't work, however. I then created a variable first and then put this into the TRACE command, like&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;nbsp; LET v_message = Weekday(Today(0)); &amp;lt;&amp;lt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt; TRACE $(v_message); &amp;lt;&amp;lt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt; LET v_message = NULL(); &amp;lt;&amp;lt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That works. That is okay, but it should be possible to use this expression directly, no?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Feb 2015 08:21:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/TRACE-directly-enter-an-expression/m-p/777131#M662305</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2015-02-24T08:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: TRACE - directly enter an expression</title>
      <link>https://community.qlik.com/t5/QlikView/TRACE-directly-enter-an-expression/m-p/777132#M662306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi DataNibbler,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it would only directly work if there are a possibilty to create an adhoc-variable within the script, like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;trace $(=function());&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore a workaround would be needed, maybe with a subroutine like this which could be outsourced in an include-variable for a global using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sub ShowTraceStament(typ, statement)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if '$(typ)' = 'string' then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; let vTrace = '$(statement)';&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; let vTrace = $(statement);&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;trace $(vTrace);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;end sub&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call ShowTraceStament('string', 'hallo welt')&lt;/P&gt;&lt;P&gt;call ShowTraceStament('numeric', 'weekday(today())')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Feb 2015 08:51:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/TRACE-directly-enter-an-expression/m-p/777132#M662306</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-02-25T08:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: TRACE - directly enter an expression</title>
      <link>https://community.qlik.com/t5/QlikView/TRACE-directly-enter-an-expression/m-p/777133#M662307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And those ad-hoc-variables don't work in the script, do they? For that's what I tried ...&lt;/P&gt;&lt;P&gt;Thanks for helping! A subroutine seems to be a little much ado for that, though - and it wouldn't really make things easier for that's pretty much what I have now.&lt;/P&gt;&lt;P&gt;I will try putting some more code in that INCLUDE, that should do the job well enough.&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Feb 2015 09:06:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/TRACE-directly-enter-an-expression/m-p/777133#M662307</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2015-02-25T09:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: TRACE - directly enter an expression</title>
      <link>https://community.qlik.com/t5/QlikView/TRACE-directly-enter-an-expression/m-p/1698177#M662308</link>
      <description>&lt;P&gt;Inspired by marcus's helpful answer, I made a simpler version.&amp;nbsp; (I didn't see any reason for the custom subroutine to handle tracing plain text when the built-in Trace() already does that just fine.)&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Sub EvaluateAndTrace(expression)
    Let e = $(expression);
	Trace $(e);
    Let e = ;
End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Usage:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Call EvaluateAndTrace('Weekday(Today())');  // Thu&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lots of examples to help with understanding the nuances:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Trace hello;                                // hello
Trace Weekday(Today());                     // Weekday(Today())
Call EvaluateAndTrace('Weekday(Today())');  // Thu

Set var = Weekday(Today());
Trace var                                   // var
Trace $(var);                               // Weekday(Today())
Call EvaluateAndTrace(var);                 // Thu

Set innerVar = Today();
Set var = Weekday($(innerVar));
Trace var;                                  // var
Trace $(var);                               // Weekday(Today())
Call EvaluateAndTrace(var);                 // Thu&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 18:45:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/TRACE-directly-enter-an-expression/m-p/1698177#M662308</guid>
      <dc:creator>mmarchese</dc:creator>
      <dc:date>2020-04-30T18:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: TRACE - directly enter an expression</title>
      <link>https://community.qlik.com/t5/QlikView/TRACE-directly-enter-an-expression/m-p/2433145#M1225504</link>
      <description>&lt;P&gt;Awesome! I'm crunching some very big data and this will allow me to easily tune the script!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 07:24:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/TRACE-directly-enter-an-expression/m-p/2433145#M1225504</guid>
      <dc:creator>shane_spencer</dc:creator>
      <dc:date>2024-03-21T07:24:23Z</dc:date>
    </item>
  </channel>
</rss>

