<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									I need to add filters in custom script. How do I do this? - Custom Scripts				            </title>
            <link>https://forums.datanyx.com/community/custom-scripts/i-need-to-add-filters-in-custom-script-how-do-i-do-this/</link>
            <description>Datanyx Support Forum</description>
            <language>en-US</language>
            <lastBuildDate>Wed, 11 Mar 2026 21:50:05 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>I need to add filters in custom script. How do I do this?</title>
                        <link>https://forums.datanyx.com/community/custom-scripts/i-need-to-add-filters-in-custom-script-how-do-i-do-this/#post-406</link>
                        <pubDate>Tue, 27 Dec 2022 11:11:25 +0000</pubDate>
                        <description><![CDATA[Step 1: Click on design and create a chart. 
Step 2: Drag and drop columns in dimension and measure.  
Step 3: Click on custom script and add custom script. (Refer to the image below). 
 ...]]></description>
                        <content:encoded><![CDATA[<div style="text-align: justify"><span data-contrast="auto">Step 1: Click on design and create a chart.</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559685&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></div>
<div style="text-align: justify"><span data-contrast="auto">Step 2: Drag and drop columns in dimension and measure. </span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559685&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></div>
<div style="text-align: justify"><span data-contrast="auto">Step 3: Click on custom script and add custom script. (Refer to the image below).</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559685&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></div>
<div id="wpfa-1983" class="wpforo-attached-file"><a class="wpforo-default-attachment" title="customscript.png" href="//forums.datanyx.com/wp-content/uploads/wpforo/default_attachments/1672139485-customscript.png" target="_blank" rel="noopener"><i class="fas fa-paperclip"></i> customscript.png</a></div>
<div>
<p style="text-align: justify"><span data-contrast="auto">Step 4: The user can add the filter query. It would look something like this:</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559685&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<p style="text-align: justify"><span data-contrast="auto">Select * From Sheet1 where column name =@Filter.Table name/custom script name</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559685&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<p style="text-align: justify"><span data-contrast="auto">Step 5: ‘Sheet1’ is the name of the data set in this particular example below. </span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559685&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<p style="text-align: justify"><span data-contrast="auto">Step 6: The query for the following data will look like this. (Refer to the image below).</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559685&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
</div>
<div id="wpfa-1985" class="wpforo-attached-file"><a class="wpforo-default-attachment" title="customscript2.png" href="//forums.datanyx.com/wp-content/uploads/wpforo/default_attachments/1672139518-customscript2.png" target="_blank" rel="noopener"><i class="fas fa-paperclip"></i> customscript2.png</a></div>
<div>
<p style="text-align: justify"><span data-contrast="auto">For instance, if you want to add filter to the column ‘Segment’, the query will be:</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559685&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<p style="text-align: justify"><span data-contrast="auto">Select * From Sheet1 where Segment=@Filter.Sheet1</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559685&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<p style="text-align: justify"><span data-contrast="auto">Step 7: You are able to add different filters. You are able to add drop down and multiselect filters. </span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559685&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<p style="text-align: justify"><span data-contrast="auto">Step 8: You need to use = to denote dropdown filter. IN is used to denote multiselect filter. </span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559685&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<p style="text-align: justify"><span data-contrast="auto">Step 9: The example query in step 6 is for a normal drop-down filter.  </span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559685&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<p style="text-align: justify"><span data-contrast="auto">Step 10: You are able to add multiple filters. Refer to the example query below:</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559685&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<p style="text-align: left"><span class="TextRun SCXW69316762 BCX0" data-contrast="auto"><span class="NormalTextRun SCXW69316762 BCX0">Select * From Sheet1 where </span><span class="NormalTextRun SCXW69316762 BCX0">Segment=@Filter.Sheet1.Segment</span><span class="NormalTextRun SCXW69316762 BCX0"> and Product IN(@Filter.S</span><span class="NormalTextRun SCXW69316762 BCX0">heet</span><span class="NormalTextRun SCXW69316762 BCX0">1.Product</span><span class="NormalTextRun SCXW69316762 BCX0">)</span><span class="NormalTextRun SCXW69316762 BCX0"> </span></span><span class="EOP SCXW69316762 BCX0" data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559685&quot;:0,&quot;335559731&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<p style="text-align: justify"><span data-contrast="auto">Step 11: The second part of the example in step 10 is for multi-select filter. Note that it needs to be given in brackets. </span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559685&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
<p style="text-align: justify"><span data-contrast="auto">Step 12: Once the query is done, click on show preview. (Refer to the images below).</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559685&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p>
</div>
<div id="wpfa-1986" class="wpforo-attached-file"><a class="wpforo-default-attachment" title="customscript1.png" href="//forums.datanyx.com/wp-content/uploads/wpforo/default_attachments/1672139591-customscript1.png" target="_blank" rel="noopener"><i class="fas fa-paperclip"></i> customscript1.png</a></div>
<div id="wpfa-1987" class="wpforo-attached-file"><a class="wpforo-default-attachment" title="customscript3.png" href="//forums.datanyx.com/wp-content/uploads/wpforo/default_attachments/1672139615-customscript3.png" target="_blank" rel="noopener"><i class="fas fa-paperclip"></i> customscript3.png</a></div>]]></content:encoded>
						                            <category domain="https://forums.datanyx.com/community/custom-scripts/">Custom Scripts</category>                        <dc:creator>Nikhila</dc:creator>
                        <guid isPermaLink="true">https://forums.datanyx.com/community/custom-scripts/i-need-to-add-filters-in-custom-script-how-do-i-do-this/#post-406</guid>
                    </item>
							        </channel>
        </rss>
		