<?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 Filter on a specific column depending on an switch indicator in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Filter-on-a-specific-column-depending-on-an-switch-indicator/m-p/227485#M79593</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Here's my sample script,&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;SelectIndicator:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;"Indicator"&lt;BR /&gt;Yes&lt;BR /&gt;No&lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;Table:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;"RecNum","ColumnB","ColumnC"&lt;BR /&gt;1, Y, N&lt;BR /&gt;2, Y, N&lt;BR /&gt;3, Y, Y&lt;BR /&gt;4, N, Y&lt;BR /&gt;5, N, Y&lt;BR /&gt;];&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;As you can see, there is no join between the 2 tables. I would like to filter on either ColumnB or ColumnC depending on the value selected from the Indicator (Yes/No).&lt;/P&gt;&lt;P&gt;If Indicator='Yes', then apply filter on ColumnB='Y', result set is as below,&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;RecNum, ColumnB, ColumnC&lt;BR /&gt;1 Y N&lt;BR /&gt;2 Y N&lt;BR /&gt;3 Y Y&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;If Indicator='No', then apply filter on ColumnC='Y', result set is as below,&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;RecNum, ColumnB, ColumnC&lt;BR /&gt;3 Y Y&lt;BR /&gt;4 N Y&lt;BR /&gt;5 N Y&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;I hope I explained the requirement much clearer now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Apr 2010 01:56:33 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-04-30T01:56:33Z</dc:date>
    <item>
      <title>Filter on a specific column depending on an switch indicator</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-on-a-specific-column-depending-on-an-switch-indicator/m-p/227481#M79589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Let's say I have 3 columns as below&lt;/P&gt;&lt;P&gt;ColumnA, ColumnB, ColumnC&lt;/P&gt;&lt;P&gt;1 Y N&lt;BR /&gt;2 Y N&lt;BR /&gt;3 Y Y&lt;BR /&gt;4 N N&lt;/P&gt;&lt;P&gt;and an Inline Indicator with values (Yes/No).&lt;/P&gt;&lt;P&gt;I would like to filter on Column B=Y if the selected Indicator is "Yes", so records 1, 2 and 3 are returned.&lt;/P&gt;&lt;P&gt;I would like to filter on ColumnC=Y if the selected Indicator is "No", so record 3 is the only record returned.&lt;/P&gt;&lt;P&gt;Can anyone please share their ideas?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Apr 2010 01:26:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-on-a-specific-column-depending-on-an-switch-indicator/m-p/227481#M79589</guid>
      <dc:creator />
      <dc:date>2010-04-29T01:26:40Z</dc:date>
    </item>
    <item>
      <title>Filter on a specific column depending on an switch indicator</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-on-a-specific-column-depending-on-an-switch-indicator/m-p/227482#M79590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anthomy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can try creating a list box with an Expression - something like "IF(..., FieldB, FieldC)" and see if it solves your problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Apr 2010 03:33:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-on-a-specific-column-depending-on-an-switch-indicator/m-p/227482#M79590</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2010-04-29T03:33:49Z</dc:date>
    </item>
    <item>
      <title>Filter on a specific column depending on an switch indicator</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-on-a-specific-column-depending-on-an-switch-indicator/m-p/227483#M79591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Oleg,&lt;/P&gt;&lt;P&gt;Thank you for your response. I would like to have the Indicator to act as a filter either to Column B or Column C depending on value selected.&lt;/P&gt;&lt;P&gt;I created a listbox with the below expression but didn't get the desired result.&lt;/P&gt;&lt;P&gt;=if([Indicator]='Yes', ColumnB, ColumnC)&lt;/P&gt;&lt;P&gt;When I select Yes, both ColumnB and ColumnC were selected with a value of Y.&lt;/P&gt;&lt;P&gt;When I select No, both ColumnB and ColumnC were selected with a value of N.&lt;/P&gt;&lt;P&gt;I was thinking of including this filter in the Load script. Any ideas ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Apr 2010 07:44:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-on-a-specific-column-depending-on-an-switch-indicator/m-p/227483#M79591</guid>
      <dc:creator />
      <dc:date>2010-04-29T07:44:02Z</dc:date>
    </item>
    <item>
      <title>Filter on a specific column depending on an switch indicator</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-on-a-specific-column-depending-on-an-switch-indicator/m-p/227484#M79592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your decision is made in the script, then you can simply link one or the other field - it doesn't even have to be dynamic. Something like this:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;...,&lt;/P&gt;&lt;P&gt;if([Indicator]='Yes', ColumnB, ColumnC) as SelectedColumn&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;and only provide the list box for "SelectedColumn"&lt;/P&gt;&lt;P&gt;am I missing your need?&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Apr 2010 14:35:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-on-a-specific-column-depending-on-an-switch-indicator/m-p/227484#M79592</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2010-04-29T14:35:06Z</dc:date>
    </item>
    <item>
      <title>Filter on a specific column depending on an switch indicator</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-on-a-specific-column-depending-on-an-switch-indicator/m-p/227485#M79593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Here's my sample script,&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;SelectIndicator:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;"Indicator"&lt;BR /&gt;Yes&lt;BR /&gt;No&lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;Table:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;"RecNum","ColumnB","ColumnC"&lt;BR /&gt;1, Y, N&lt;BR /&gt;2, Y, N&lt;BR /&gt;3, Y, Y&lt;BR /&gt;4, N, Y&lt;BR /&gt;5, N, Y&lt;BR /&gt;];&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;As you can see, there is no join between the 2 tables. I would like to filter on either ColumnB or ColumnC depending on the value selected from the Indicator (Yes/No).&lt;/P&gt;&lt;P&gt;If Indicator='Yes', then apply filter on ColumnB='Y', result set is as below,&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;RecNum, ColumnB, ColumnC&lt;BR /&gt;1 Y N&lt;BR /&gt;2 Y N&lt;BR /&gt;3 Y Y&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;If Indicator='No', then apply filter on ColumnC='Y', result set is as below,&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;RecNum, ColumnB, ColumnC&lt;BR /&gt;3 Y Y&lt;BR /&gt;4 N Y&lt;BR /&gt;5 N Y&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;I hope I explained the requirement much clearer now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Apr 2010 01:56:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-on-a-specific-column-depending-on-an-switch-indicator/m-p/227485#M79593</guid>
      <dc:creator />
      <dc:date>2010-04-30T01:56:33Z</dc:date>
    </item>
    <item>
      <title>Filter on a specific column depending on an switch indicator</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-on-a-specific-column-depending-on-an-switch-indicator/m-p/227486#M79594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd do it like this:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;FilterBySwitch:&lt;BR /&gt;LOAD&lt;BR /&gt; RecNum&lt;BR /&gt;,'Yes' as Indicator&lt;BR /&gt;RESIDENT Table&lt;BR /&gt;WHERE ColumnB = 'Y'&lt;BR /&gt;;&lt;BR /&gt;CONCATENATE LOAD&lt;BR /&gt; RecNum&lt;BR /&gt;,'No' as Indicator&lt;BR /&gt;RESIDENT Table&lt;BR /&gt;WHERE ColumnC = 'Y'&lt;BR /&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Apr 2010 21:38:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-on-a-specific-column-depending-on-an-switch-indicator/m-p/227486#M79594</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-04-30T21:38:30Z</dc:date>
    </item>
    <item>
      <title>Filter on a specific column depending on an switch indicator</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-on-a-specific-column-depending-on-an-switch-indicator/m-p/227487#M79595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;Thank you for your response. Your code works !&lt;/P&gt;&lt;P&gt;However, I'm loading millions of records here, so when ColumnB and Columnc C are both 'Y', they will be loaded twice, one for Indicator= 'Yes' and one for Indicator='No'. I would like to avoid such scenario.&lt;/P&gt;&lt;P&gt;Is there a way to use a variable and assign that variable the Indicator's Value to filter on the Table ?&lt;/P&gt;&lt;P&gt;Something like this -&lt;/P&gt;&lt;P&gt;LET IndicatorVar = Indicator column from Indicator Table;&lt;/P&gt;&lt;P&gt;Select&lt;/P&gt;&lt;P&gt;RecNum,&lt;/P&gt;&lt;P&gt;ColumnA,&lt;/P&gt;&lt;P&gt;ColumnB&lt;/P&gt;&lt;P&gt;From table&lt;/P&gt;&lt;P&gt;where ((ColumnA = 'Y' and '$(IndicatorVar)'='Yes' ) or (ColumnB = 'Y' and '$(IndicatorVar)'='No' ))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 May 2010 20:33:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-on-a-specific-column-depending-on-an-switch-indicator/m-p/227487#M79595</guid>
      <dc:creator />
      <dc:date>2010-05-13T20:33:40Z</dc:date>
    </item>
    <item>
      <title>Filter on a specific column depending on an switch indicator</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-on-a-specific-column-depending-on-an-switch-indicator/m-p/227488#M79596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why do you want to avoid loading the data twice? Time taken during the load? Memory taken during the load? Memory taken in the final product? QlikView, generally speaking, doesn't have the same sort of problems with "redundant" data that most systems have. It's read only, so you can't make a mistake and update one copy but not another. And its compression algorithm should squish the redundant information down pretty small.&lt;/P&gt;&lt;P&gt;In MY experience, the most critical piece of the performance/memory puzzle is the chart performance, because that directly impacts your users. Chart performance is maximized when QlikView's normal associative logic does all the work for you, as it does in my example.&lt;/P&gt;&lt;P&gt;That said, yes, you can do it with a variable and an expression instead of with data. You'll save a little memory and load time, and your chart will be a little slower. Unlike with the data approach, setting the variable will ONLY affect charts with the specialized code, not all charts. Or perhaps I'm misunderstood you. Anyway, see attached.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 May 2010 21:07:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-on-a-specific-column-depending-on-an-switch-indicator/m-p/227488#M79596</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-05-13T21:07:22Z</dc:date>
    </item>
  </channel>
</rss>

