<?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 Switch syntax, datasources management in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Switch-syntax-datasources-management/m-p/141542#M21195</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;For the filesize function, try putting the filename variable in single quotes as it is a string value:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;B&gt;LET&lt;/B&gt; vSize = filesize(&lt;B&gt;&lt;I&gt;'$(vFileName)'&lt;/I&gt;&lt;/B&gt;); &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Apr 2009 15:02:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-04-16T15:02:21Z</dc:date>
    <item>
      <title>Switch syntax, datasources management</title>
      <link>https://community.qlik.com/t5/QlikView/Switch-syntax-datasources-management/m-p/141540#M21193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everybody !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm a new user for the awesome tool QlikView and i have a few questions about it.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;First of all, i'm trying to use the switch syntax but i don't think i really understood how it works.&lt;/LI&gt;&lt;/OL&gt;&lt;P style="padding-left: 90px;"&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;=if(Country='France','FR',&lt;BR /&gt; if(Country='Austria','AUS',&lt;BR /&gt; Country))&lt;BR /&gt;&lt;BR /&gt;=switch Country&lt;BR /&gt;case 'France'&lt;BR /&gt; 'FR';&lt;BR /&gt;case 'Austria'&lt;BR /&gt; 'AUS';&lt;BR /&gt;default&lt;BR /&gt; Country;&lt;BR style="padding-left: 30px;" /&gt;end switch&lt;BR style="padding-left: 30px;" /&gt;&lt;/PRE&gt;&lt;BR /&gt;2. Datasources management&lt;BR /&gt;I would like to create several QVW files for the publishing part. &lt;BR /&gt;For instance, a checkAvailability.qvw, after this a createQVD.qvw... &lt;BR /&gt;However, i don't know how i can check the availability of the datasources:&lt;BR /&gt;&lt;BR /&gt; &lt;P style="padding-left: 30px;"&gt;For the files, i've thought about the FileSize function but .... not working ...&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR style="padding-left: 30px;" /&gt;LET vFileName = 'file1.txt';&lt;BR /&gt;LET vSize = filesize($(vFileName));&lt;BR /&gt;if($(vSize)&amp;gt;0,MsgBox('ok'),MsgBox('ko'));&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;IMG alt="error loading image" class="jive-image error-loading-image" src="https://community.qlik.com/legacyfs/online/-221_sourceID:221" /&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P style="padding-left: 60px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;I think it's enough for a first post &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 14:22:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Switch-syntax-datasources-management/m-p/141540#M21193</guid>
      <dc:creator />
      <dc:date>2009-04-16T14:22:50Z</dc:date>
    </item>
    <item>
      <title>Switch syntax, datasources management</title>
      <link>https://community.qlik.com/t5/QlikView/Switch-syntax-datasources-management/m-p/141541#M21194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For the switch statement, a full command must be placed for each case/scenario. Let me edit your code so it becomes more 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;=switch Country&lt;BR /&gt;case 'France'&lt;BR /&gt; LER Country = 'FR';&lt;BR /&gt;case 'Austria'&lt;BR /&gt; LET Country = 'AUS';&lt;BR /&gt;default&lt;BR /&gt; LET Country = Country;&lt;BR style="padding-left:30px;" /&gt;end switch&lt;BR style="padding-left:30px;" /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;in your filesize function, try removing the dollar expansion in your if so it becomes like&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;if(vSize&amp;gt;0, etc. etc.)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 14:37:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Switch-syntax-datasources-management/m-p/141541#M21194</guid>
      <dc:creator />
      <dc:date>2009-04-16T14:37:25Z</dc:date>
    </item>
    <item>
      <title>Switch syntax, datasources management</title>
      <link>https://community.qlik.com/t5/QlikView/Switch-syntax-datasources-management/m-p/141542#M21195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;For the filesize function, try putting the filename variable in single quotes as it is a string value:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;B&gt;LET&lt;/B&gt; vSize = filesize(&lt;B&gt;&lt;I&gt;'$(vFileName)'&lt;/I&gt;&lt;/B&gt;); &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 15:02:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Switch-syntax-datasources-management/m-p/141542#M21195</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-16T15:02:21Z</dc:date>
    </item>
    <item>
      <title>Switch syntax, datasources management</title>
      <link>https://community.qlik.com/t5/QlikView/Switch-syntax-datasources-management/m-p/141543#M21196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks rainong, but i don't think its working&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;=switch Country&lt;BR /&gt;case 'FR'&lt;BR /&gt; LET Country = 'France';&lt;BR /&gt;case 'UK'&lt;BR /&gt; LET Country = 'UnitedKinkgdoms';&lt;BR /&gt;default&lt;BR /&gt; LET Country = Country;&lt;BR /&gt;&lt;BR /&gt;end switch&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;it displays an empty list box.... &lt;span class="lia-unicode-emoji" title=":neutral_face:"&gt;😐&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And, for your other answer,&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;//LET vFileName = 'file1.txt';&lt;BR /&gt;LET vSize = filesize('file1.txt');//$(vFileName));&lt;BR /&gt;if($(vSize)&amp;gt;0,&lt;BR /&gt; MsgBox('ok','cool'),&lt;BR /&gt; MsgBox('ko','dead')&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;it displays another error message&lt;BR /&gt; &lt;A href="http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/2671.error.JPG"&gt;&lt;IMG alt="" border="0" src="http://community.qlik.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Discussions.Components.Files/11/2671.error.JPG" /&gt;&lt;BR /&gt;&lt;/A&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 15:05:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Switch-syntax-datasources-management/m-p/141543#M21196</guid>
      <dc:creator />
      <dc:date>2009-04-16T15:05:38Z</dc:date>
    </item>
    <item>
      <title>Switch syntax, datasources management</title>
      <link>https://community.qlik.com/t5/QlikView/Switch-syntax-datasources-management/m-p/141544#M21197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, JSN, but it displays the same message, but with different values &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&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;LET vFileName = 'file1.txt';&lt;BR /&gt;LET vSize = filesize('$(vFileName)');&lt;BR /&gt;if($(vSize)&amp;gt;0,MsgBox('ok'),MsgBox('ko'));&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;IMG alt="" /&gt;&lt;A href="http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/1108.error.JPG"&gt;&lt;IMG alt="" border="0" src="http://community.qlik.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Discussions.Components.Files/11/1108.error.JPG" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 15:13:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Switch-syntax-datasources-management/m-p/141544#M21197</guid>
      <dc:creator />
      <dc:date>2009-04-16T15:13:32Z</dc:date>
    </item>
    <item>
      <title>Switch syntax, datasources management</title>
      <link>https://community.qlik.com/t5/QlikView/Switch-syntax-datasources-management/m-p/141545#M21198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see Frank,&lt;/P&gt;&lt;P&gt;it does seem like msgbox is causing the issue since the vSize variable is at least populated.&lt;/P&gt;&lt;P&gt;Try this approach instead:&lt;/P&gt;&lt;P&gt;LET vFileName = 'file1.txt';&lt;BR /&gt;LET vSize = filesize('$(vFileName)');&lt;BR /&gt;if $(vSize)&amp;gt;0 then&lt;BR /&gt;let mbox1=msgbox('ok');&lt;BR /&gt;else&lt;BR /&gt;let mbox1=msgbox('ko');&lt;BR /&gt;end if&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 15:23:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Switch-syntax-datasources-management/m-p/141545#M21198</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-16T15:23:17Z</dc:date>
    </item>
    <item>
      <title>Switch syntax, datasources management</title>
      <link>https://community.qlik.com/t5/QlikView/Switch-syntax-datasources-management/m-p/141546#M21199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jsn, it's working !! &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now my next question is do you know how it is possible to "return" a value (for instance, the script didn't finish successfull and i would like to notify the publisher of this...). Moreover,does QV provide a die() function ? Indeed, the aim of this script is to check the availability of the datasources and, if the datasources are OK, it launches the next process (the QVD creation). However, if we want this to be successfull, it means QV and QV Publisher can exchange values...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks Jsn &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 15:38:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Switch-syntax-datasources-management/m-p/141546#M21199</guid>
      <dc:creator />
      <dc:date>2009-04-16T15:38:02Z</dc:date>
    </item>
    <item>
      <title>Switch syntax, datasources management</title>
      <link>https://community.qlik.com/t5/QlikView/Switch-syntax-datasources-management/m-p/141547#M21200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The way to exit a script is with the statement:&lt;/P&gt;&lt;P&gt;exit script;&lt;/P&gt;&lt;P&gt;I believe I saw an earlier post about generating an error exit by conditionally executing a statement that will fail such as:&lt;/P&gt;&lt;P&gt;LOAD * FROM nofile.txt;&lt;/P&gt;&lt;P&gt;You can also use the TRACE script statement to write messages to the logfile.&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 16:00:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Switch-syntax-datasources-management/m-p/141547#M21200</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2009-04-16T16:00:48Z</dc:date>
    </item>
    <item>
      <title>Switch syntax, datasources management</title>
      <link>https://community.qlik.com/t5/QlikView/Switch-syntax-datasources-management/m-p/141548#M21201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well,&lt;/P&gt;&lt;P&gt;To stop the script execution you can use the "Exit Script" statement that can also take a when condition.&lt;/P&gt;&lt;P&gt;As for getting several QV reloads to work together, couldn't you use QV Publisher and dependencies? A dependency between two tasks only launches the second task if the first one finished without errors.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 16:02:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Switch-syntax-datasources-management/m-p/141548#M21201</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-16T16:02:45Z</dc:date>
    </item>
    <item>
      <title>Switch syntax, datasources management</title>
      <link>https://community.qlik.com/t5/QlikView/Switch-syntax-datasources-management/m-p/141549#M21202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried to test the script when the file is missing.&lt;BR /&gt;QV crashes when i try to get the size of a missing file:&lt;/P&gt;&lt;P&gt;&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;LET vFileName = 'file2.txt';&lt;BR /&gt;LET vSize = filesize('$(vFileName)');&lt;BR /&gt;if ($(vSize)&amp;gt;0) then&lt;BR /&gt;let mbox1=msgbox('ok');&lt;BR /&gt;else&lt;BR /&gt;let mbox1=msgbox('ko');&lt;BR /&gt;end if&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;A href="http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/2768.error.JPG"&gt;&lt;IMG alt="" border="0" src="http://community.qlik.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Discussions.Components.Files/11/2768.error.JPG" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Does someone know on which version are QV Publisher dependencies included ? I remember there are two Publisher versions, Standard &amp;amp; Enterprise Editions .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ANd about the switch syntax, can someone help me ? &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&amp;lt;pre&amp;gt;=switch Country&lt;BR /&gt;case 'FR'&lt;BR /&gt; LET Country = 'France';&lt;BR /&gt;case 'UK'&lt;BR /&gt; LET Country = 'UnitedKinkgdoms';&lt;BR /&gt;default&lt;BR /&gt; LET Country = Country;&lt;BR /&gt;&lt;BR /&gt;end switch&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 17:53:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Switch-syntax-datasources-management/m-p/141549#M21202</guid>
      <dc:creator />
      <dc:date>2009-04-16T17:53:09Z</dc:date>
    </item>
    <item>
      <title>Switch syntax, datasources management</title>
      <link>https://community.qlik.com/t5/QlikView/Switch-syntax-datasources-management/m-p/141550#M21203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm experiencing the same problem with the switch function and I can not find the correct syntax.&lt;/P&gt;&lt;P&gt;More over I would like to change a different variable "VAR" as follow:&lt;/P&gt;&lt;P&gt;=switch Country&lt;BR /&gt;case 'FR'&lt;BR /&gt; LET VAR = 'France';&lt;BR /&gt;case 'UK'&lt;BR /&gt; LET VAR = 'UnitedKinkgdoms';&lt;BR /&gt;default&lt;BR /&gt; LET VAR = 'Else';&lt;BR /&gt;&lt;BR /&gt;end switch&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you suggest some solution?&lt;/P&gt;&lt;P&gt;Thank you very much for your help.&lt;/P&gt;&lt;P&gt;r.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jun 2009 03:59:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Switch-syntax-datasources-management/m-p/141550#M21203</guid>
      <dc:creator />
      <dc:date>2009-06-16T03:59:59Z</dc:date>
    </item>
  </channel>
</rss>

