<?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 Problem with comparison between variable &amp; loaded field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-comparison-between-variable-loaded-field/m-p/786875#M278379</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I seem to be having a problem with my if condition.&amp;nbsp; It works just fine on a date field but I seem to have a problem if the field is text.&lt;/P&gt;&lt;P&gt;I have two different files that I'm loading in;&lt;/P&gt;&lt;P&gt;Here is part of one of the files:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;CompanyID ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 670 as Parent_Comp,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AssetID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AcquisitionDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year(AcquisitionDate) as Acquisition_Year,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month(AcquisitionDate) as Acquisition_Period,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WarrantyDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AcqValue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is part of the other file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ASSETID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SEQUENCE_NUMBER,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FISCAL_YEAR,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PARENT_COMP,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BEG_BALANCE, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BEG_DEPRECIATION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two created a pivot table to display my information and I also created a variable called vAssetYr so that the user can input what year they want to look at.&lt;/P&gt;&lt;P&gt;I have two different if conditions where one seems to work and the other doesn't and I suspect that it has something to do with the data type.&lt;/P&gt;&lt;P&gt;Here are the if conditions:&lt;/P&gt;&lt;P&gt;=if(Acquisition_Year=$(vAssetYr), AcqValue],0)&amp;nbsp;&amp;nbsp; (this one works)&lt;/P&gt;&lt;P&gt;=if(Fiscal_Year=$(vAssetYr), Beg_Depreciation]),0)&amp;nbsp;&amp;nbsp; (this one doesn't work)&lt;/P&gt;&lt;P&gt;I'm assuming this has something to do with the fact that Acquisition_Year is derived from a date field and &lt;/P&gt;&lt;P&gt;Fiscal_Year in the other file is coming in as a text field???????&lt;/P&gt;&lt;P&gt;How can I get around this?????&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Feb 2015 14:57:52 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-02-11T14:57:52Z</dc:date>
    <item>
      <title>Problem with comparison between variable &amp; loaded field</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-comparison-between-variable-loaded-field/m-p/786875#M278379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I seem to be having a problem with my if condition.&amp;nbsp; It works just fine on a date field but I seem to have a problem if the field is text.&lt;/P&gt;&lt;P&gt;I have two different files that I'm loading in;&lt;/P&gt;&lt;P&gt;Here is part of one of the files:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;CompanyID ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 670 as Parent_Comp,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AssetID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AcquisitionDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year(AcquisitionDate) as Acquisition_Year,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month(AcquisitionDate) as Acquisition_Period,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WarrantyDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AcqValue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is part of the other file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ASSETID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SEQUENCE_NUMBER,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FISCAL_YEAR,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PARENT_COMP,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BEG_BALANCE, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BEG_DEPRECIATION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two created a pivot table to display my information and I also created a variable called vAssetYr so that the user can input what year they want to look at.&lt;/P&gt;&lt;P&gt;I have two different if conditions where one seems to work and the other doesn't and I suspect that it has something to do with the data type.&lt;/P&gt;&lt;P&gt;Here are the if conditions:&lt;/P&gt;&lt;P&gt;=if(Acquisition_Year=$(vAssetYr), AcqValue],0)&amp;nbsp;&amp;nbsp; (this one works)&lt;/P&gt;&lt;P&gt;=if(Fiscal_Year=$(vAssetYr), Beg_Depreciation]),0)&amp;nbsp;&amp;nbsp; (this one doesn't work)&lt;/P&gt;&lt;P&gt;I'm assuming this has something to do with the fact that Acquisition_Year is derived from a date field and &lt;/P&gt;&lt;P&gt;Fiscal_Year in the other file is coming in as a text field???????&lt;/P&gt;&lt;P&gt;How can I get around this?????&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 14:57:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-comparison-between-variable-loaded-field/m-p/786875#M278379</guid>
      <dc:creator />
      <dc:date>2015-02-11T14:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with comparison between variable &amp; loaded field</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-comparison-between-variable-loaded-field/m-p/786876#M278380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks that these tables have no connection and you tried to select and calculate over variables - this isn't a recommended way to use qlikview. Therefore try to build a datamodel where the tables are assigned to each other and use for date-fields the approach with one or several master-calendar:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-blog-small" data-containerid="2588" data-containertype="37" data-objectid="2802" data-objecttype="38" href="http://community.qlik.com/blogs/qlikviewdesignblog/2012/10/16/the-master-calendar"&gt;http://community.qlik.com/blogs/qlikviewdesignblog/2012/10/16/the-master-calendar&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-blog-small" data-containerid="2588" data-containertype="37" data-objectid="3585" data-objecttype="38" href="http://community.qlik.com/blogs/qlikviewdesignblog/2014/02/17/canonical-date"&gt;http://community.qlik.com/blogs/qlikviewdesignblog/2014/02/17/canonical-date&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-blog-small" data-containerid="2588" data-containertype="37" data-objectid="2730" data-objecttype="38" href="http://community.qlik.com/blogs/qlikviewdesignblog/2012/08/30/master-table-with-multiple-roles#comment-12934"&gt;http://community.qlik.com/blogs/qlikviewdesignblog/2012/08/30/master-table-with-multiple-roles#comment-12934&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-blog-small" data-containerid="2588" data-containertype="37" data-objectid="3138" data-objecttype="38" href="http://community.qlik.com/blogs/qlikviewdesignblog/2013/05/28/fiscal-year#comment-18790"&gt;http://community.qlik.com/blogs/qlikviewdesignblog/2013/05/28/fiscal-year#comment-18790&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 16:03:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-comparison-between-variable-loaded-field/m-p/786876#M278380</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-02-11T16:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with comparison between variable &amp; loaded field</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-comparison-between-variable-loaded-field/m-p/786877#M278381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The tables are connected.&amp;nbsp; I have a join on the tables &amp;amp; I just didn't put it in the writeup.&lt;/P&gt;&lt;P&gt;Also, I have 2 separate pivot tables for my data.&lt;/P&gt;&lt;P&gt;One table has this in the expression and it works just fine: =if(Acquisition_Year=$(vAssetYr), AcqValue,0)&lt;/P&gt;&lt;P&gt;The other table has this: =if(Fiscal_Year=$(vAssetYr), BegDepreciation],0) I can't seem to get any numbers to show up.&amp;nbsp; It's almost like the fiscal year isn't being recognized.&amp;nbsp; I created a mini table just to verify the fiscal year field has data and it definitely does.&amp;nbsp; I have a record that contains 2014 for the fiscal_year and I'm inputting 2014 but it will not pull the record in my pivot table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 16:35:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-comparison-between-variable-loaded-field/m-p/786877#M278381</guid>
      <dc:creator />
      <dc:date>2015-02-11T16:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with comparison between variable &amp; loaded field</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-comparison-between-variable-loaded-field/m-p/786878#M278382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not each association will lead to the expected connection. Why didn't you use simple a field year to select the associated values in both tables?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another possible reason to get not the expected values is to use fields without aggregation - if is only one fieldvalue available then an expression would return a result but if there are more the expression wille be return NULL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-blog-small" data-containerid="2588" data-containertype="37" data-objectid="3235" data-objecttype="38" href="http://community.qlik.com/blogs/qlikviewdesignblog/2013/08/06/it-s-all-aggregations"&gt;http://community.qlik.com/blogs/qlikviewdesignblog/2013/08/06/it-s-all-aggregations&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-blog-small" data-containerid="2588" data-containertype="37" data-objectid="3779" data-objecttype="38" href="http://community.qlik.com/blogs/qlikviewdesignblog/2014/06/16/use-the-aggregation-functions"&gt;http://community.qlik.com/blogs/qlikviewdesignblog/2014/06/16/use-the-aggregation-functions&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 16:46:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-comparison-between-variable-loaded-field/m-p/786878#M278382</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-02-11T16:46:37Z</dc:date>
    </item>
  </channel>
</rss>

