<?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 Re: I am new to Databricks SQL and want to create a variable which can hold calculations either from static values or from select queries similar to SQL Server. Is there a way to do so? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/i-am-new-to-databricks-sql-and-want-to-create-a-variable-which/m-p/25517#M17757</link>
    <description>&lt;P&gt;Got your point. Thank you very much for the help&lt;/P&gt;</description>
    <pubDate>Mon, 21 Mar 2022 10:41:25 GMT</pubDate>
    <dc:creator>Sudeshna</dc:creator>
    <dc:date>2022-03-21T10:41:25Z</dc:date>
    <item>
      <title>I am new to Databricks SQL and want to create a variable which can hold calculations either from static values or from select queries similar to SQL Server. Is there a way to do so?</title>
      <link>https://community.databricks.com/t5/data-engineering/i-am-new-to-databricks-sql-and-want-to-create-a-variable-which/m-p/25511#M17751</link>
      <description>&lt;P&gt;I was trying to create a variable and i got the following error -&lt;/P&gt;&lt;P&gt;command - &lt;/P&gt;&lt;P&gt;SET a = 5;&lt;/P&gt;&lt;P&gt;Error -&lt;/P&gt;&lt;P&gt;Error running query&lt;/P&gt;&lt;P&gt;Configuration a is not available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 18:49:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/i-am-new-to-databricks-sql-and-want-to-create-a-variable-which/m-p/25511#M17751</guid>
      <dc:creator>Sudeshna</dc:creator>
      <dc:date>2022-03-15T18:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: I am new to Databricks SQL and want to create a variable which can hold calculations either from static values or from select queries similar to SQL Server. Is there a way to do so?</title>
      <link>https://community.databricks.com/t5/data-engineering/i-am-new-to-databricks-sql-and-want-to-create-a-variable-which/m-p/25512#M17752</link>
      <description>&lt;P&gt;Hello @Sudeshna Bhakat​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for posting on Databricks Community Forum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please use Dashboard filters&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.databricks.com/sql/user/queries/query-filters.html" alt="https://docs.databricks.com/sql/user/queries/query-filters.html" target="_blank"&gt;https://docs.databricks.com/sql/user/queries/query-filters.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Query&lt;/P&gt;&lt;P&gt;SELECT l_linenumber AS linenumber, COUNT(*) AS cnt FROM lineitem WHERE l_linenumber = {{var}}&lt;/P&gt;&lt;P&gt;GROUP BY l_linenumber&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Query editor looks like below&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/2015i569C22F555866D0D/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you add this query to the dashboard, the var looks like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dashboard&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Dashboard"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/2021i5E64902FA25FBDA0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Dashboard" alt="Dashboard" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let us know if this works for you.&lt;/P&gt;&lt;P&gt;I have filed a feature request internally to support this. &lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 16:42:11 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/i-am-new-to-databricks-sql-and-want-to-create-a-variable-which/m-p/25512#M17752</guid>
      <dc:creator>User16764241763</dc:creator>
      <dc:date>2022-03-16T16:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: I am new to Databricks SQL and want to create a variable which can hold calculations either from static values or from select queries similar to SQL Server. Is there a way to do so?</title>
      <link>https://community.databricks.com/t5/data-engineering/i-am-new-to-databricks-sql-and-want-to-create-a-variable-which/m-p/25513#M17753</link>
      <description>&lt;P&gt;Here is an example of the syntax:&lt;/P&gt;&lt;P&gt;set a.variablename = value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then to use it you need to reference it with ${a.variablename}.  See the screenshot&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2022 12:25:03 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/i-am-new-to-databricks-sql-and-want-to-create-a-variable-which/m-p/25513#M17753</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-17T12:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: I am new to Databricks SQL and want to create a variable which can hold calculations either from static values or from select queries similar to SQL Server. Is there a way to do so?</title>
      <link>https://community.databricks.com/t5/data-engineering/i-am-new-to-databricks-sql-and-want-to-create-a-variable-which/m-p/25514#M17754</link>
      <description>&lt;P&gt;@Sudeshna Bhakat​&amp;nbsp;what @Joseph Kambourakis​&amp;nbsp;described works on clusters but is restricted on Databricks SQL endpoints i.e. only a limited number of SET commands are allowed. I suggest you explore the curly-braces (e.g. {{ my_variable }}) in Databricks SQL.&lt;/P&gt;</description>
      <pubDate>Sun, 20 Mar 2022 08:35:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/i-am-new-to-databricks-sql-and-want-to-create-a-variable-which/m-p/25514#M17754</guid>
      <dc:creator>BilalAslamDbrx</dc:creator>
      <dc:date>2022-03-20T08:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: I am new to Databricks SQL and want to create a variable which can hold calculations either from static values or from select queries similar to SQL Server. Is there a way to do so?</title>
      <link>https://community.databricks.com/t5/data-engineering/i-am-new-to-databricks-sql-and-want-to-create-a-variable-which/m-p/25515#M17755</link>
      <description>&lt;P&gt;Using curly braces means it will create parameters. but i don't need a parameter. There is no way other than creating a parameter?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 10:18:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/i-am-new-to-databricks-sql-and-want-to-create-a-variable-which/m-p/25515#M17755</guid>
      <dc:creator>Sudeshna</dc:creator>
      <dc:date>2022-03-21T10:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: I am new to Databricks SQL and want to create a variable which can hold calculations either from static values or from select queries similar to SQL Server. Is there a way to do so?</title>
      <link>https://community.databricks.com/t5/data-engineering/i-am-new-to-databricks-sql-and-want-to-create-a-variable-which/m-p/25516#M17756</link>
      <description>&lt;P&gt;No, not yet. For now, you can only use SET commands to set a limited number of configuration options.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 10:39:39 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/i-am-new-to-databricks-sql-and-want-to-create-a-variable-which/m-p/25516#M17756</guid>
      <dc:creator>BilalAslamDbrx</dc:creator>
      <dc:date>2022-03-21T10:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: I am new to Databricks SQL and want to create a variable which can hold calculations either from static values or from select queries similar to SQL Server. Is there a way to do so?</title>
      <link>https://community.databricks.com/t5/data-engineering/i-am-new-to-databricks-sql-and-want-to-create-a-variable-which/m-p/25517#M17757</link>
      <description>&lt;P&gt;Got your point. Thank you very much for the help&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 10:41:25 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/i-am-new-to-databricks-sql-and-want-to-create-a-variable-which/m-p/25517#M17757</guid>
      <dc:creator>Sudeshna</dc:creator>
      <dc:date>2022-03-21T10:41:25Z</dc:date>
    </item>
  </channel>
</rss>

