<?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 combine formula in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/combine-formula/m-p/366909#M61671</link>
    <description>&lt;P&gt;Hi, could someone help me combine the 2 formulas below? The second one is simply minus the time of day part. Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;----------------------------------------&lt;/P&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Column( "week start",
Numeric,
"Nominal",
Format( "m/d/y", 12 ),
Input Format( "m/d/y" ),
Formula(
If( Day Of Week( :WR_Date ) == 1,
(:WR_Date - In Days( Day Of Week( :WR_Date ) )) - In Days( 5 ),
(:WR_Date - In Days( Day Of Week( :WR_Date ) )) + In Days( 2 )
)
),
Set Selected
),
New Column( "Date[week start]",
Numeric,
"Nominal",
Format( "m/d/y", 12 ),
Input Format( "m/d/y" ),
Formula( :week start - Time Of Day( :week start ) ),
Set Selected
),&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 22:08:07 GMT</pubDate>
    <dc:creator>joann</dc:creator>
    <dc:date>2023-06-09T22:08:07Z</dc:date>
    <item>
      <title>combine formula</title>
      <link>https://community.jmp.com/t5/Discussions/combine-formula/m-p/366909#M61671</link>
      <description>&lt;P&gt;Hi, could someone help me combine the 2 formulas below? The second one is simply minus the time of day part. Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;----------------------------------------&lt;/P&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Column( "week start",
Numeric,
"Nominal",
Format( "m/d/y", 12 ),
Input Format( "m/d/y" ),
Formula(
If( Day Of Week( :WR_Date ) == 1,
(:WR_Date - In Days( Day Of Week( :WR_Date ) )) - In Days( 5 ),
(:WR_Date - In Days( Day Of Week( :WR_Date ) )) + In Days( 2 )
)
),
Set Selected
),
New Column( "Date[week start]",
Numeric,
"Nominal",
Format( "m/d/y", 12 ),
Input Format( "m/d/y" ),
Formula( :week start - Time Of Day( :week start ) ),
Set Selected
),&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 22:08:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/combine-formula/m-p/366909#M61671</guid>
      <dc:creator>joann</dc:creator>
      <dc:date>2023-06-09T22:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: combine formula</title>
      <link>https://community.jmp.com/t5/Discussions/combine-formula/m-p/366947#M61675</link>
      <description>&lt;P&gt;I'm doing this quickly, but I think this would work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Column( "Date[week start]",
Numeric,
"Nominal",
Format( "m/d/y", 12 ),
Input Format( "m/d/y" ),
Formula( ( If( Day Of Week( :WR_Date ) == 1,
(:WR_Date - In Days( Day Of Week( :WR_Date ) )) - In Days( 5 ),
(:WR_Date - In Days( Day Of Week( :WR_Date ) )) + In Days( 2 )
) )
 - 
Time Of Day( ( If( Day Of Week( :WR_Date ) == 1,
(:WR_Date - In Days( Day Of Week( :WR_Date ) )) - In Days( 5 ),
(:WR_Date - In Days( Day Of Week( :WR_Date ) )) + In Days( 2 )
) ) )&amp;nbsp;)&amp;nbsp;)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;All I did is copied the first formula (for "week start") and replaced every reference to "week start" in the second formula with the copied information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I added some extra spaces to (hopefully) see the formula&amp;nbsp; a little bit easier.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also note that I did absolutely no testing to ensure this is correct.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Mar 2021 01:31:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/combine-formula/m-p/366947#M61675</guid>
      <dc:creator>Dan_Obermiller</dc:creator>
      <dc:date>2021-03-11T01:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: combine formula</title>
      <link>https://community.jmp.com/t5/Discussions/combine-formula/m-p/367008#M61695</link>
      <description>&lt;P&gt;I think you could also directly remove Time Of Day(:WR_Date) because the result of that if statement should have same hours, minutes and seconds as the :WR_Date column&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Formula(
	If(Day Of Week(:WR_Date) == 1,
		(:WR_Date - In Days(Day Of Week(:WR_Date))) - In Days(5),
		(:WR_Date - In Days(Day Of Week(:WR_Date))) + In Days(2)
	) - Time Of Day(:WR_Date)
),&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Mar 2021 09:13:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/combine-formula/m-p/367008#M61695</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-03-11T09:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: combine formula</title>
      <link>https://community.jmp.com/t5/Discussions/combine-formula/m-p/367222#M61718</link>
      <description>Thank you Dan! This works!</description>
      <pubDate>Thu, 11 Mar 2021 16:39:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/combine-formula/m-p/367222#M61718</guid>
      <dc:creator>joann</dc:creator>
      <dc:date>2021-03-11T16:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: combine formula</title>
      <link>https://community.jmp.com/t5/Discussions/combine-formula/m-p/367223#M61719</link>
      <description>Thank you Jarmo! This works!</description>
      <pubDate>Thu, 11 Mar 2021 16:40:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/combine-formula/m-p/367223#M61719</guid>
      <dc:creator>joann</dc:creator>
      <dc:date>2021-03-11T16:40:15Z</dc:date>
    </item>
  </channel>
</rss>

