<?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: Lookup in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Lookup/m-p/373573#M704424</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not certain whether I need to use the lookup function or not. I am sorry if the title of my post was misleading.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached a table of level scores which shows the ranges of the level score, which are correlated with the average quality.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jan:&lt;/P&gt;&lt;P&gt;Quality score= 100&lt;/P&gt;&lt;P&gt;Level Score= 5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Feb:&lt;/P&gt;&lt;P&gt;Quality Score =88.50&lt;/P&gt;&lt;P&gt;Level Score = 4.50&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mar:&lt;/P&gt;&lt;P&gt;Quality Score=83.10&lt;/P&gt;&lt;P&gt;Level Score=.05&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to be able to get an average of the two and three month quality score and look up that value in the attached table. So in this example, the 3 month quality score would be (100+88.50+83.10)/3= 92.5 and the leveling score would be a 5.&amp;nbsp; This is the type of logic I am trying to incorporate in my script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see the attached table for further details regarding the call score and the level score ranges.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 May 2012 20:09:22 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-05-29T20:09:22Z</dc:date>
    <item>
      <title>Lookup</title>
      <link>https://community.qlik.com/t5/QlikView/Lookup/m-p/373571#M704422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to do a lookup on a specific performance related metric. Each customer service rep receives an average of 5 call scores each month on a 0-100 range. After that, the agent also receives a leveling score on a 1-5 range based on the monthly average of the call score. I am trying to get my script so that whenever I select a range of months, the script does a loookup from an excel spreadsheet. Currently when I select a range of months I am getting an average of the leveling scores rather than receiving a leveling value based on the average of the call scores. I hope my explanation makes sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Quality:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Directory;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; '' AS Date,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Year &amp;amp; '-' &amp;amp; LEFT(Month,3) AS YearMonth,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Associate AS Rep_Name, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Associate &amp;amp; Year &amp;amp; '-' &amp;amp; LEFT(Month,3) AS RepYearMonth,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(Score) &lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM \\swqlikv1\QLIKVIEW\1_Resources\ContactCenter\CallScoreAssignments.xls (biff, embedded labels, table is [Eval Assignments$])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WHERE Year &amp;gt;= 2010;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Quality1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;YearMonth,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Rep_Name,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RepYearMonth,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Round(Avg(DISTINCT(Score)),-.1) As Quality&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident Quality&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Group By&amp;nbsp; Rep_Name, YearMonth, RepYearMonth;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Drop Table Quality;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Left Join (Quality1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Round((Quality),-.1) As Quality, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; [Quality Level] AS Quality_Level&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Leveling.xlsx&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(ooxml, embedded labels, table is Sheet1);&lt;/STRONG&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;STRONG&gt;Please let me know if you need any further information. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thank you,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2012 18:23:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lookup/m-p/373571#M704422</guid>
      <dc:creator />
      <dc:date>2012-05-29T18:23:45Z</dc:date>
    </item>
    <item>
      <title>Lookup</title>
      <link>https://community.qlik.com/t5/QlikView/Lookup/m-p/373572#M704423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Saurav S,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure if I fully understood what your want to achieve. Could you post some sample lines of data together with your expected result?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lookup() is a script function, so I believe you can't call this function when you make any selections in the front end.&lt;/P&gt;&lt;P&gt;If you are not talking about the QV lookup function, please clarify your setting and requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2012 19:25:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lookup/m-p/373572#M704423</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-05-29T19:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup</title>
      <link>https://community.qlik.com/t5/QlikView/Lookup/m-p/373573#M704424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not certain whether I need to use the lookup function or not. I am sorry if the title of my post was misleading.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached a table of level scores which shows the ranges of the level score, which are correlated with the average quality.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jan:&lt;/P&gt;&lt;P&gt;Quality score= 100&lt;/P&gt;&lt;P&gt;Level Score= 5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Feb:&lt;/P&gt;&lt;P&gt;Quality Score =88.50&lt;/P&gt;&lt;P&gt;Level Score = 4.50&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mar:&lt;/P&gt;&lt;P&gt;Quality Score=83.10&lt;/P&gt;&lt;P&gt;Level Score=.05&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to be able to get an average of the two and three month quality score and look up that value in the attached table. So in this example, the 3 month quality score would be (100+88.50+83.10)/3= 92.5 and the leveling score would be a 5.&amp;nbsp; This is the type of logic I am trying to incorporate in my script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see the attached table for further details regarding the call score and the level score ranges.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2012 20:09:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lookup/m-p/373573#M704424</guid>
      <dc:creator />
      <dc:date>2012-05-29T20:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup</title>
      <link>https://community.qlik.com/t5/QlikView/Lookup/m-p/373574#M704425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Saurav S,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;guess you can get your result with different approaches, best is depending the context (where you want to display the result).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've loaded your table and created some Scores for some Months.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In global context, you can get your Quality Level by using something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=only({&amp;lt;Quality= {$(=num(floor(avg(Score),0.1),'#.00'))}&amp;gt;} [Quality Level])&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here I use a set expression to filter on the Quality with value &lt;EM&gt;num(floor(avg(Score),0.1),'#.00') &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;This looks a bit strange, the num(floor()) is just to match your number format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a table, you can achieve similar using&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=aggr(if(floor(avg(Score),0.1)= Quality,[Quality Level]),Month,Quality)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See attached for a sample file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2012 21:12:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lookup/m-p/373574#M704425</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-05-29T21:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup</title>
      <link>https://community.qlik.com/t5/QlikView/Lookup/m-p/373575#M704426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Stefan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The number in the text box is exactly what I want but I do not want it to display in a textbox. Is it acceptable to write this in the script? If so, where? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: Arial;"&gt;=only({&amp;lt;Quality= {$(=num(floor(avg(Score),0.1),'#.00'))}&amp;gt;} [Quality Level])&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: Arial;"&gt;I have uploaded the script with the actual call scores so this may help. I also changed the month format to Year-Month, because that is the format I need the data.&lt;/EM&gt;&lt;EM style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: Arial;"&gt; &lt;/EM&gt;&lt;EM style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: Arial;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the all of your help thus far. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Saurav&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-size: 12px; background-color: #ffffff; font-family: Arial;"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2012 13:22:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lookup/m-p/373575#M704426</guid>
      <dc:creator />
      <dc:date>2012-05-30T13:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup</title>
      <link>https://community.qlik.com/t5/QlikView/Lookup/m-p/373576#M704427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, you can't use a set expression in the script (since the data model is not completely built at this time, selecting on field values will not work).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you don't want to show it in a text box, where do you want to show it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could create a variable in Settings-&amp;gt;Variable Overview and name it e.g. vTest with definition&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=only({&amp;lt;Quality= {$(=num(floor(avg(Score),0.1),'#.00'))}&amp;gt;} [Quality Level])&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then use this variable anywhere in your objects (it will just hold the value as calculated and shown in the text object):&lt;/P&gt;&lt;P&gt;=vTest&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See also attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With regard to your Year-Month, I would suggest using Monthname() function instead, which will still hold the month start date in the numerical representation or maybe&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Date(monthstart(Date),'YYYY-MMM') as YearMonth,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you need a different formatting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;EM&gt;,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Stefan&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2012 13:35:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lookup/m-p/373576#M704427</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-05-30T13:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup</title>
      <link>https://community.qlik.com/t5/QlikView/Lookup/m-p/373577#M704428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think your suggestion works fine for this situation, however, I have a multiple metrics that I need to apply similar logic to. I thought there would be a much simpler solution to this, since I am already getting the monthly levels scores that I want. My logic breaks when I try to get a leveling score for several months. Instead of looking at the ranges for the quality leveling score I am getting an &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;average&lt;/STRONG&gt;&lt;/SPAN&gt; of the quality leveling scores, which is slightly different. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have uploaded my script to show you how I am currently scripting this. I will need to apply a similar logic to other metrics as well. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2012 14:58:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lookup/m-p/373577#M704428</guid>
      <dc:creator />
      <dc:date>2012-05-30T14:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup</title>
      <link>https://community.qlik.com/t5/QlikView/Lookup/m-p/373578#M704429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please explain this formula. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: Arial;"&gt;=only({&amp;lt;Quality= {$(=num(floor(avg(Score),0.1),'#.00'))}&amp;gt;} [Quality Level])&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: Arial;"&gt;Thank You!&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2012 15:00:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lookup/m-p/373578#M704429</guid>
      <dc:creator />
      <dc:date>2012-05-30T15:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup</title>
      <link>https://community.qlik.com/t5/QlikView/Lookup/m-p/373579#M704430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Saurav, S&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I noticed that your last load &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Left Join (Quality1)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Round(Quality,-.1) As Quality1,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;[Quality Level] AS Quality_Level1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;Y&gt;&lt;/Y&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(ooxml, embedded labels, table is Sheet1);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will create a full Quality / QualityLevel table per existing record (beacuse you renamed the fields and there are no matching fields in the joining table Quality1). Is this what you intend to do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking at your problem, you only have problems with the total line in your table, right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could use a variable as suggested above and then use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=if(dimensionality()=0,vTest,avg(DISTINCT([Quality Level])))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to use your variable only for the total line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your quality / quality level is not changing day to day (i.e. your table / logic will not be changed by the users in the excel), you could also get rid of the lookup and calculated the quality level on the fly using a dollar sign expansion with arguments:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Define a variable vQL (no equal sign here):&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if($1&amp;gt;=89,5,if($1&amp;gt;=85,($1-85)+1,if($1&amp;gt;=83,($1-83)/2,0)))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then in your expression use:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=$(vQL(avg(Quality)))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See attached for both approaches.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S: Regarding your last post, what do you &lt;EM&gt;think &lt;/EM&gt;this expression does?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2012 17:05:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lookup/m-p/373579#M704430</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-05-30T17:05:36Z</dc:date>
    </item>
  </channel>
</rss>

