<?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 Using prompts and calculations as query limits - how? in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-prompts-and-calculations-as-query-limits-how/m-p/92193#M8528</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Relatively new SAS EG 4.3 user, as our enterprise just switched from Hyperion. I'm LOVING the functionality EG provides.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a simple query with one table. I'm going to simplify the build below for purposes of explanation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;TABLE 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Field 1&lt;/P&gt;&lt;P&gt;Date 1&lt;/P&gt;&lt;P&gt;Dollar Amount 1&lt;/P&gt;&lt;P&gt;Row Insert Effective Date&lt;/P&gt;&lt;P&gt;Row Insert Expiration Date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want to be able to do is build a query that brings back the value in 'Dollar Amount 1' at a certain point in time (we call this 'time traveling' in our analytics group). Our datamart allows for this by manipulating the values in the Row Insert fields. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have successfully run this query by using this limit:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Row Insert Effective Date = Date 1 + 30 (or 60, or 90, or...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But ideally, in order to create a template query, I want to have a prompt called "NumberOfDays", which is set to be an integer between 0 and 365. Then my limit would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Row Insert Effective Date = Date 1 + NumberOfDays&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get an error when I try to use this prompt within a limit calculation. The error is "ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant, a missing value, BTRIM, INPUT, PUT, SUBSTRING, USER." &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I stuck hard-coding this with the actual number of days, or is there just a syntax issue when using a prompt within a calculation in a query limit?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks all!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Oct 2012 13:51:49 GMT</pubDate>
    <dc:creator>Proulx06</dc:creator>
    <dc:date>2012-10-11T13:51:49Z</dc:date>
    <item>
      <title>Using prompts and calculations as query limits - how?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-prompts-and-calculations-as-query-limits-how/m-p/92193#M8528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Relatively new SAS EG 4.3 user, as our enterprise just switched from Hyperion. I'm LOVING the functionality EG provides.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a simple query with one table. I'm going to simplify the build below for purposes of explanation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;TABLE 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Field 1&lt;/P&gt;&lt;P&gt;Date 1&lt;/P&gt;&lt;P&gt;Dollar Amount 1&lt;/P&gt;&lt;P&gt;Row Insert Effective Date&lt;/P&gt;&lt;P&gt;Row Insert Expiration Date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want to be able to do is build a query that brings back the value in 'Dollar Amount 1' at a certain point in time (we call this 'time traveling' in our analytics group). Our datamart allows for this by manipulating the values in the Row Insert fields. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have successfully run this query by using this limit:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Row Insert Effective Date = Date 1 + 30 (or 60, or 90, or...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But ideally, in order to create a template query, I want to have a prompt called "NumberOfDays", which is set to be an integer between 0 and 365. Then my limit would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Row Insert Effective Date = Date 1 + NumberOfDays&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get an error when I try to use this prompt within a limit calculation. The error is "ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant, a missing value, BTRIM, INPUT, PUT, SUBSTRING, USER." &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I stuck hard-coding this with the actual number of days, or is there just a syntax issue when using a prompt within a calculation in a query limit?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks all!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2012 13:51:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-prompts-and-calculations-as-query-limits-how/m-p/92193#M8528</guid>
      <dc:creator>Proulx06</dc:creator>
      <dc:date>2012-10-11T13:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using prompts and calculations as query limits - how?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-prompts-and-calculations-as-query-limits-how/m-p/92194#M8529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using the prompt for a filter?&amp;nbsp; If so, then be sure to check the box "Generate filter for a prompt value" on the Filter definition window.&amp;nbsp; That will generate the appropriate syntax (%eg_whereparam) that will "unwrap" the prompt value from its macro format into a value that's good for the query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2012 14:02:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-prompts-and-calculations-as-query-limits-how/m-p/92194#M8529</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2012-10-11T14:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using prompts and calculations as query limits - how?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-prompts-and-calculations-as-query-limits-how/m-p/92195#M8530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ended up finding the solution in another topic thread. What I failed to do was go into the query options and register the prompt in the Query Options. Once I did that it prompted me for the value and the plugged that value into my limit calculation. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2012 15:31:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Using-prompts-and-calculations-as-query-limits-how/m-p/92195#M8530</guid>
      <dc:creator>Proulx06</dc:creator>
      <dc:date>2012-10-11T15:31:27Z</dc:date>
    </item>
  </channel>
</rss>

