<?xml version="1.0" encoding="utf-8"?> 
<rss version="2.0">

<channel>

<title>LEFT JOIN: blog on analytics, visualisation &amp; data science, posts tagged: parameter</title>
<link>https://en.leftjoin.ru/tags/parameter/</link>
<description></description>
<generator>E2 (v3386; Aegea)</generator>

<item>
<title>Using parameters in Redash</title>
<guid isPermaLink="false">16</guid>
<link>https://en.leftjoin.ru/all/using-redash-parameters/</link>
<comments>https://en.leftjoin.ru/all/using-redash-parameters/</comments>
<description>
&lt;p&gt;The most convenient and useful thing in Redash is parameters. Parameters can be both in a report and in dashboards.&lt;br /&gt;
Parameter – is an element of the interface, controlled by a user producing a report.&lt;/p&gt;
&lt;p&gt;Parameter in a report can be of the following types:&lt;/p&gt;
&lt;div class="e2-text-picture"&gt;
&lt;div class="fotorama" data-width="541" data-ratio="1.9049295774648"&gt;
&lt;img src="https://en.leftjoin.ru/pictures/redash-parameter@2x.png" width="541" height="284" alt="" /&gt;
&lt;img src="https://en.leftjoin.ru/pictures/redash-parameter-v2@2x.png" width="540" height="267" alt="" /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Each type explained separately:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;i&gt;Text&lt;/i&gt; – text input field, can be used in constructions of LIKE type, such parameter &lt;a href="https://redash.io/help/user-guide/querying/query-parameters#FAQ"&gt;can’t be applied in public dashboards&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Number&lt;/i&gt; – number, entered by a user&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Dropdown list&lt;/i&gt; – list of values, from which a user can select just one or several values (not long ago, an option of multi-entry of parameters in a dropdown list appeared)&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Query dropdown list&lt;/i&gt; – similarly to the previous one, however the values will be taken from the existing query results&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Date&lt;/i&gt; / &lt;i&gt;Date and Time&lt;/i&gt; / &lt;i&gt;Date and Time (with seconds)&lt;/i&gt; – fields of date entry&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Date Range&lt;/i&gt; / &lt;i&gt;Date and Time Range&lt;/i&gt; / &lt;i&gt;Date and Time Range (with seconds)&lt;/i&gt; –  fields of date ranges entry.&lt;br /&gt;
It’s convenient to use for the following construction&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="e2-text-code"&gt;&lt;code&gt;between '{{parameter.start}}' and '{{parameter.end}}'&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In case of dashboard, a situation might arise, when a parameter is named the same way in several queries, then it will become common for all the dashboard, it’s handy.&lt;/p&gt;
&lt;p&gt;One of not obvious, but rather useful solutions: how to make a parameter &lt;b&gt;disabled&lt;/b&gt;?&lt;br /&gt;
Let’s assume, that parameter of “dropdown list” type is named &lt;i&gt;parameter&lt;/i&gt; and we want to set it for a column &lt;i&gt;geo&lt;/i&gt; of a table, then the code of the query will look approximately like that:&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code&gt;WHERE
    ('{{parameter}}' = 'Disabled' or geo = '{{parameter}}')&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;At that, surely, ‘Disabled’ should be added to the values of the dropdown list.&lt;/p&gt;
</description>
<pubDate>Tue, 28 Jan 2020 14:22:01 +0300</pubDate>
</item>


</channel>
</rss>