<?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 How can I load expression conditionally? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-can-I-load-expression-conditionally/m-p/186301#M50436</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Steve, thanks and your solution works!&lt;BR /&gt;&lt;BR /&gt;The only addition to your solution is I need to load Y and N to the token.&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [TOKEN&lt;BR /&gt;Y,&lt;BR /&gt;N];&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Nov 2010 22:14:04 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-11-15T22:14:04Z</dc:date>
    <item>
      <title>How can I load expression conditionally?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-load-expression-conditionally/m-p/186297#M50432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In our application, we have 6 expressions to aggregate data.&lt;/P&gt;&lt;P&gt;However, depending on user's security setting, most users should ONLY see 3 expressions loaded in list box. So I need a way to load Expression listbox dynamiclly.&lt;BR /&gt;&lt;BR /&gt;I had following codes in my loading script, but it does not work:&lt;BR /&gt;&lt;BR /&gt;&lt;I&gt;secTmp:&lt;BR /&gt;select securityToken from $(DBOWNER).sysSecurity where logonid = QVUser()&lt;BR /&gt;let secToken = FieldValue(securityToken,1);&lt;/I&gt;&lt;/P&gt;&lt;P style="font-style: italic"&gt;Exp:&lt;BR /&gt;load * inline [Exp&lt;BR /&gt;Sales&lt;BR /&gt;SaleQty&lt;BR /&gt;% of Total Sales&lt;BR /&gt;] ;&lt;/P&gt;&lt;P style="font-style: italic"&gt;if ($(secToken)= 'Y') then&lt;BR /&gt; concatenate( Exp)&lt;BR /&gt; load * inline [Exp&lt;BR /&gt; COGS&lt;BR /&gt; Margin&lt;BR /&gt; Margin %&lt;BR /&gt; ] ;&lt;BR /&gt;end if&lt;/P&gt;&lt;P&gt;Qlikview first complained QVUser is not a valid function, and then complained my if block has syntax error.&lt;BR /&gt;&lt;BR /&gt;Anyone help me ??? Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Nov 2010 23:39:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-load-expression-conditionally/m-p/186297#M50432</guid>
      <dc:creator />
      <dc:date>2010-11-13T23:39:34Z</dc:date>
    </item>
    <item>
      <title>How can I load expression conditionally?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-load-expression-conditionally/m-p/186298#M50433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Paul,&lt;/P&gt;&lt;P&gt;I see some syntax errors, that may be typos when writing this post, but it's worth looking at it in your original code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;select securityToken from $(DBOWNER).sysSecurity where logonid = &lt;STRONG&gt;'QVUser()'&lt;/STRONG&gt;; // quoted since it's a literal and semicolon to end the line let secToken = FieldValue(&lt;B&gt;'securityToken'&lt;/B&gt;,1); // fieldnames in fieldvalue are always quoted&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Now it should work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Nov 2010 12:12:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-load-expression-conditionally/m-p/186298#M50433</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-11-14T12:12:52Z</dc:date>
    </item>
    <item>
      <title>How can I load expression conditionally?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-load-expression-conditionally/m-p/186299#M50434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wish I had addressed my issue more clear in original post.&lt;BR /&gt;&lt;BR /&gt;I have users list stored in a security table, and the user list is loaded in Section access.&lt;/P&gt;&lt;P&gt;Say, 2 users,&lt;BR /&gt;&lt;BR /&gt;User Token&lt;BR /&gt;A Y&lt;BR /&gt;B N&lt;BR /&gt;&lt;BR /&gt;Then I have a listbox called 'Expression' , which is using inline load in Section Application.&lt;BR /&gt;&lt;BR /&gt;My requirement is: when a user's Token is 'Y', I want the listbox be loaded values A and B and C;&lt;BR /&gt; when a user's Token is 'N', I want the listbox be loaded values A and B only (without C).&lt;BR /&gt;&lt;BR /&gt;Kind of dynamic loading of a listbox, depending on user's setting.&lt;BR /&gt;&lt;BR /&gt;I am not sure if I can use function QVUser() in loading script since QVUser() is used to access who is opening my document on the server.&lt;BR /&gt;&lt;BR /&gt;I checked Qlikview's data reduction and still don't get the idea.&lt;BR /&gt;&lt;BR /&gt;Any idea? Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Nov 2010 17:41:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-load-expression-conditionally/m-p/186299#M50434</guid>
      <dc:creator />
      <dc:date>2010-11-14T17:41:30Z</dc:date>
    </item>
    <item>
      <title>How can I load expression conditionally?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-load-expression-conditionally/m-p/186300#M50435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;This solution won't work because, as you have identified, the QVUser() function is not relevant at load time. Even if it was, it would return the user who was performing the reload, not one of your end users.&lt;/P&gt;&lt;P&gt;What you should probably look at is linking the users to the data like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;&lt;BR /&gt;Section Access;&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt; ACCESS, USERID, TOKEN&lt;BR /&gt; ADMIN, ADMIN, *&lt;BR /&gt; USER, USER1, Y&lt;BR /&gt; USER, USER2, N&lt;BR /&gt;];&lt;BR /&gt;Section Application;&lt;BR /&gt;&lt;BR /&gt;ListBox:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt; TOKEN, ListboxValue&lt;BR /&gt; Y, A&lt;BR /&gt; N, A&lt;BR /&gt; Y, B&lt;BR /&gt; N, B&lt;BR /&gt; Y, C&lt;BR /&gt;];&amp;lt;div&amp;gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Note that the "TOKEN" field must be in caps and the values in it must be caps too.&lt;/DIV&gt;&lt;DIV&gt;Now, when User1 logs in they will see A, B, C. When user2 logs in they will see just A,B.&lt;/DIV&gt;&lt;DIV&gt;Also note that this field doesn't have to be related to the rest of your dataset. If it is though, User2 will also not see any data that is associated with the "C" value.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Regards,&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Stephen&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Nov 2010 21:45:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-load-expression-conditionally/m-p/186300#M50435</guid>
      <dc:creator>stephencredmond</dc:creator>
      <dc:date>2010-11-14T21:45:05Z</dc:date>
    </item>
    <item>
      <title>How can I load expression conditionally?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-load-expression-conditionally/m-p/186301#M50436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Steve, thanks and your solution works!&lt;BR /&gt;&lt;BR /&gt;The only addition to your solution is I need to load Y and N to the token.&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [TOKEN&lt;BR /&gt;Y,&lt;BR /&gt;N];&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Nov 2010 22:14:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-load-expression-conditionally/m-p/186301#M50436</guid>
      <dc:creator />
      <dc:date>2010-11-15T22:14:04Z</dc:date>
    </item>
  </channel>
</rss>

