title: Lookup with where clause ssrs?
body: <p>I have a question about a look up function in ssrs. After some research on the forum I managed it to a certain degree. However the last step I can't solve.</p>
  
  <p>In my report I am using two data sets. One set with some costumer parameters and one data set with the turnover grouped by (tip out of this forum) costumer ID and year. With this costumer ID I link the two tables.</p>
  
  <pre><code>=lookup(Fields!cmp_wwn.Value,Fields!cmp_wwn.Value, Fields!Omzet.Value,  "Omzet")
  </code></pre>
  
  <p>When I use the code above I get the first value out of the set. However I want to specify which year I want to show.</p>
  
  <p>With the code below I have tried it again.</p>
  
  <pre><code>=lookup(
  Fields!cmp_wwn.Value &amp; "-" &amp; "2015",
  Fields!cmp_wwn.Value &amp; "-" &amp; Fields!Datumjaar.Value,
  Fields!Omzet.Value,  "Omzet")
  </code></pre>
  
  <p>The warning below appears. 
  Warning 1   [rsRuntimeErrorInExpression] The Value expression for the textrun ‘Textbox8.Paragraphs[0].TextRuns[0]’ contains an error: Operator '&amp;' is not defined for type 'Guid' and string "-".   </p>
  
  <p>Just to give you an idea of the two data sets:
  Dataset 1:</p>
  
  <pre><code>    SELECT        Status, StartDate, Jaar, 
  Maand, Week, cmp_name, Accountmanager, Classificatie, cmp_fcity, Description, RequestComments, fullname, res_id, cmp_code, target, 
                           cmp_wwn
  FROM            _VW_ALKLIMAET_MRS_Bezoekverslagen
  </code></pre>
  
  <p>Dataset 2:</p>
  
  <pre><code>SELECT        SUM(bdr_val) AS Omzet, Datumjaar, cmp_wwn
  FROM            _VW_ALKLIMAET_MRS_omzet
  WHERE        (Datumjaar &gt; 2013)
  GROUP BY Datumjaar, cmp_wwn
  </code></pre>
  
  <hr>
  
  <p><strong>Sample data of Dataset 1:</strong>
  Status  Start date  Year    Month   Week    Relation name   Account manager Realtion classification City    fullname    ID fullname Costumer code   Target  Relation ID
  Status  Startdate   Jaar    Maand   Week    cmp_name    Accountmanager  Classificatie   cmp_fcity   fullname    res_id  cmp_code    target  cmp_wwn
  3   12-8-2014 8:00  2014    8   33  van Dorp Hengelo    Martijn Moekotte    Unknown HENGELO Martijn Moekotte                                                    849             2010935 0   4a3a0504-c255-4e91-b106-0000972bb783
  3   4-6-2013 13:30  2013    6   23  Witte Koeltechniek BV   Marco van der Haven B Installateur  NOORD-SCHARWOUDE    Marco van der Haven                                                 815              200183 0   cfa97188-c76a-457c-ba78-003d499d86bc
  3   6-11-2013 10:00 2013    11  45  Witte Koeltechniek BV   Marco van der Haven B Installateur  NOORD-SCHARWOUDE    Marco van der Haven                                                 815              200183 0   cfa97188-c76a-457c-ba78-003d499d86bc</p>
  
  <p><strong>Sample data of Dataset 2:</strong></p>
  
  <ul>
  <li>Turnover DataYear    Relation ID Omzet      Datumjaar    cmp_wwn
  -36755,5 2015    f887da07-08ad-4479-84ec-1459be5e3311
  -105     2016    ba9e2640-291f-43ee-af5b-559245af165c
  -6409        2014    c06cb96c-026a-4274-9db2-89cf9c8ccb2b
  -176     2014    70968c94-b3b9-43a0-8b2b-18e62583c75f</li>
  </ul>