<?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 Re: Help writing a sort function in an expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169730#M463324</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't use an If() statement because that is dependent on a selection. I need the red column to always display only the data where code = '1', regardless of other selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm hoping there is someway to do a While() statement or something that functions just like it with Qlikview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In terms of supplying a small mockup of my data, what would you like to see?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alec&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Jul 2016 15:39:59 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-07-15T15:39:59Z</dc:date>
    <item>
      <title>Help writing a sort function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169728#M463322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to create a dashboard which takes quantities from a SQL file, divides them by quantities in an Excel file, and will display the percentages accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the SQL file, the quantities are divided up by a column with a certain code. If this code matches the code in the Excel file, it should divide them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, lets say the first red column shown below has a code of '1', the yellow has a code of '2', green of '3'. etc. I want the expression within this chart for the red column to display only the SQL data which has a matching code of '1', the yellow column to&lt;/P&gt;&lt;P&gt;display only the SQL data that has a code of '2', the green for '3', etc. Can someone please help me correctly write out these expression statements? So far, I have &lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;QuantityInSQL&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)/&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;QuantityInExcel&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) , but I need to make it something like =While(Code = '1', &lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;QuantityInSQL&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)/&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;QuantityInExcel&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) for the red column, =While(Code = '2', &lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;QuantityInSQL&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)/&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;QuantityInExcel&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) for the yellow column, etc. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Obviously the While() statement doesn't work in Qlikview, and I can't figure out how to do it in a way that Qlikview will understand.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Any help is greatly appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Thank you,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Alec&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;IMG alt="Ex..png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/131455_Ex..png" style="width: 620px; height: 274px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2016 13:58:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169728#M463322</guid>
      <dc:creator />
      <dc:date>2016-07-15T13:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: Help writing a sort function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169729#M463323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you use a simple if statement like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(ExcelCode = SQLCode, &lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0000ff;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #800000;"&gt;QuantityInSQL&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;)/&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0000ff;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #800000;"&gt;QuantityInExcel&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;P&gt;Can you give a small mock-up of what your data looks like? Maybe some stuff can be done easier in loadscript, then used in the dashboard.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2016 15:29:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169729#M463323</guid>
      <dc:creator>jerem1234</dc:creator>
      <dc:date>2016-07-15T15:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: Help writing a sort function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169730#M463324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't use an If() statement because that is dependent on a selection. I need the red column to always display only the data where code = '1', regardless of other selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm hoping there is someway to do a While() statement or something that functions just like it with Qlikview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In terms of supplying a small mockup of my data, what would you like to see?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alec&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2016 15:39:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169730#M463324</guid>
      <dc:creator />
      <dc:date>2016-07-15T15:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Help writing a sort function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169731#M463325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are your fields for the SQL Data and Excel Data linked in the data model or are they separated?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for mockup data, I'm just looking for what your data model looks like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can provide made up data with like 5 rows of data for your SQL and Excel tables similar to something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQLCode, QuantityInSQL&lt;/P&gt;&lt;P&gt;5, 45&lt;/P&gt;&lt;P&gt;4, 60&lt;/P&gt;&lt;P&gt;3, 70&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then do an ExcelCode table, and then say whether or not they are linked or there is actually only one table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will help deduce whether to combat the problem in the loadscript or with an expression in the dashboard.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2016 15:55:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169731#M463325</guid>
      <dc:creator>jerem1234</dc:creator>
      <dc:date>2016-07-15T15:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help writing a sort function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169732#M463326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Certainly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, I have&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQLCode, QuantityInSQL&lt;/P&gt;&lt;P&gt;1, 2&lt;/P&gt;&lt;P&gt;1, 5&lt;/P&gt;&lt;P&gt;1, 3&lt;/P&gt;&lt;P&gt;1, 7&lt;/P&gt;&lt;P&gt;2, 2&lt;/P&gt;&lt;P&gt;2, 7&lt;/P&gt;&lt;P&gt;2, 4&lt;/P&gt;&lt;P&gt;2, 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would need my charts to say the red column (code 1)&amp;nbsp; has a quantity of 17, the yellow column (code 2) has a quantity of 16, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and they are linked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I still need all of the data in the loadscript, because I am also combining these QuantitiesInSQL together, ignoring the SQLCode, in a different chart, contained in the same container. For this chart, I need it to be separated by SQLCode. I hope this makes sense, I can definitely clarify if it is confusing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alec&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2016 16:37:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169732#M463326</guid>
      <dc:creator />
      <dc:date>2016-07-15T16:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: Help writing a sort function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169733#M463327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What table has QuanitityInExcel? Can you show what that table might look like and how its linked to the QuantityinSQL table?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2016 17:32:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169733#M463327</guid>
      <dc:creator>jerem1234</dc:creator>
      <dc:date>2016-07-15T17:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Help writing a sort function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169734#M463328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;did you try to rename the excel code field and the sql code filed with the same name?&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;or could you post your model (ctrl +t, table viewer)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2016 17:51:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169734#M463328</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2016-07-15T17:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: Help writing a sort function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169735#M463329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's linked up inside of Qlikview, I have posted a picture below for reference. The smaller table on the left is from SQL, the larger one on the right is from Excel. I have also placed a picture of the excel table below that. These are the quantities for different locations, and each row corresponds to a different part number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG border="0" class="jive-image image-1" height="267" src="https://community.qlik.com/legacyfs/online/131515_pastedImage_2.png" style="max-height: 900px; max-width: 1200px;" width="459" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="excel.png" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/131519_excel.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2016 19:06:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169735#M463329</guid>
      <dc:creator />
      <dc:date>2016-07-15T19:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help writing a sort function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169736#M463330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG border="0" class="jive-image image-1" height="267" src="https://community.qlik.com/legacyfs/online/131520_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" width="459" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the model, and I do have one field (PartMPN) which is named the same name in both the SQL and the Excel table so it is the PK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2016 19:07:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169736#M463330</guid>
      <dc:creator />
      <dc:date>2016-07-15T19:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: Help writing a sort function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169737#M463331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So is it the case you want the table to show no matter what selections you have?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try adding set analysis in:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0000ff;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;({1}&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #800000;"&gt;QuantityInSQL&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;)/&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0000ff;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; ({1}&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #800000;"&gt;QuantityInExcel&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;{1} will ignore all the selections you have.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;If you need to use the solution I listed above while ignoring selections try doing:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if(only({1}SQLCode) = only({1}ExcelCode), Sum({1}QuantityInSQL)/Sum ({1}QuantityInExcel))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 8pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 8pt; line-height: 1.5em;"&gt;Let me know if this helps or I am misunderstanding your requirements!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2016 19:24:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169737#M463331</guid>
      <dc:creator>jerem1234</dc:creator>
      <dc:date>2016-07-15T19:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Help writing a sort function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169738#M463332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jeremiah,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I apologize for my late reply, I have been out of the office for the last several days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want it to show no matter what the selections are. It will always be populated with data featuring different codes, and I need it to display each code as a separate bar on the bar graph. I believe your solution above will be helpful, I am going to try it and will update with results. In addition, if anything I've said here helps to clarify what I am looking for, please feel free to let me know any ideas you may have.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alec&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2016 13:14:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169738#M463332</guid>
      <dc:creator />
      <dc:date>2016-07-20T13:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: Help writing a sort function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169739#M463333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jeremiah,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried your solution and found you are understanding exactly what I am looking for. One small issue though, with the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 8pt;"&gt;if(only({1}SQLCode) = only({1}ExcelCode), Sum({1}QuantityInSQL)/Sum ({1}QuantityInExcel))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want it to say something more like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 8pt;"&gt;if(only({1}SQLCode) = '1', Sum({1}QuantityInSQL)/Sum ({1}QuantityInExcel))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The problem I am having is that it is saying there is no data to display when I do it like this. I have also tried:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 8pt;"&gt;if(only({1}SQLCode) = '1', Sum(QuantityInSQL)/Sum (QuantityInExcel))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 8pt;"&gt;if(SQLCode = '1', Sum({1}QuantityInSQL)/Sum ({1}QuantityInExcel))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and I'm having no luck. Do you know what I can do to make it work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for your help, I really do appreciate it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alec&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2016 15:42:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169739#M463333</guid>
      <dc:creator />
      <dc:date>2016-07-21T15:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help writing a sort function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169740#M463334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi alec,&lt;/P&gt;&lt;P&gt;consider loading the excel data using cross-table statement.&lt;/P&gt;&lt;P&gt;Yair.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2016 18:38:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169740#M463334</guid>
      <dc:creator />
      <dc:date>2016-07-21T18:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Help writing a sort function in an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169741#M463335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for getting back so late, but I am not quite sure what you are seeking. For your purpose, I would use the SQL Code as a dimension and then use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0000ff;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;({1}&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #800000;"&gt;QuantityInSQL&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;)/&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0000ff;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; ({1}&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #800000;"&gt;QuantityInExcel&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 8pt; line-height: 1.5em;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 8pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;as the expression in the bar chart.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Aug 2016 14:50:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-writing-a-sort-function-in-an-expression/m-p/1169741#M463335</guid>
      <dc:creator>jerem1234</dc:creator>
      <dc:date>2016-08-18T14:50:24Z</dc:date>
    </item>
  </channel>
</rss>

