<?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: Counting values in column in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Counting-values-in-column/m-p/714204#M89755</link>
    <description>&lt;P&gt;The attached may work - I added a column (intermediate counter) which I then used in a revised Counter column (using the Col Cumulative Sum function).&amp;nbsp; There may be a way to do it using the Date Difference function, but I couldn't get that to work easily.&amp;nbsp; For the second question, what I've done in the past is create two new columns using the Left and Right functions so that 13.5 becomes 13 in the first and .5 in the second.&amp;nbsp; Then create a column using the InMinutes function for the second (e.g. 0.5) column divided by 60.&amp;nbsp; InMinutes measures some number of hours in seconds (why is it called InMinutes?), so the division by 60 makes 0.5 30 seconds.&amp;nbsp; Then you can concatenate the first column (with the hours) and this new column with a : in between.&amp;nbsp; I sure hope someone has a better method!&lt;/P&gt;</description>
    <pubDate>Mon, 08 Jan 2024 19:40:39 GMT</pubDate>
    <dc:creator>dlehman1</dc:creator>
    <dc:date>2024-01-08T19:40:39Z</dc:date>
    <item>
      <title>Counting values in column</title>
      <link>https://community.jmp.com/t5/Discussions/Counting-values-in-column/m-p/714151#M89754</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help using the Count function.&amp;nbsp; I think I may be able to us this for what I need but not sure how.&amp;nbsp; I've attached a sample data table.&amp;nbsp; For the Column "day night 5 min intervals" I want to use a formula to count the number of values of the same number in the column "Counter"&amp;nbsp; (This is to help me calculate the length of day and length of night)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created the day or night columns and the counter columns to get me to my final result in Day/night hours. Unless there is an easier way to do this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And follow up question:&amp;nbsp; Is there an easy way to turn a duration (number of hours in decimal format) into hr: min.&amp;nbsp; For example - 13.5 hrs becomes 13:30.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2024 19:01:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Counting-values-in-column/m-p/714151#M89754</guid>
      <dc:creator>EmilyT</dc:creator>
      <dc:date>2024-01-08T19:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Counting values in column</title>
      <link>https://community.jmp.com/t5/Discussions/Counting-values-in-column/m-p/714204#M89755</link>
      <description>&lt;P&gt;The attached may work - I added a column (intermediate counter) which I then used in a revised Counter column (using the Col Cumulative Sum function).&amp;nbsp; There may be a way to do it using the Date Difference function, but I couldn't get that to work easily.&amp;nbsp; For the second question, what I've done in the past is create two new columns using the Left and Right functions so that 13.5 becomes 13 in the first and .5 in the second.&amp;nbsp; Then create a column using the InMinutes function for the second (e.g. 0.5) column divided by 60.&amp;nbsp; InMinutes measures some number of hours in seconds (why is it called InMinutes?), so the division by 60 makes 0.5 30 seconds.&amp;nbsp; Then you can concatenate the first column (with the hours) and this new column with a : in between.&amp;nbsp; I sure hope someone has a better method!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2024 19:40:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Counting-values-in-column/m-p/714204#M89755</guid>
      <dc:creator>dlehman1</dc:creator>
      <dc:date>2024-01-08T19:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Counting values in column</title>
      <link>https://community.jmp.com/t5/Discussions/Counting-values-in-column/m-p/714209#M89756</link>
      <description>&lt;P&gt;For the first part you should be able to use Col Sum with If (you don't need If if you are fine that all cells have values)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(Row() == Col Max(Row(), :Counter),
	Col Sum(1, :Counter)
,
	.
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;other option could be to use &lt;EM&gt;Col Number(:Counter, :Counter)&lt;/EM&gt; (add similar if statement if you need it).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the other question, I would most likely create new formula column with &lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;In Hours(:"Day/night hours"n)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;and then change the format (you could also multiply by 60*60 (In hours does this, it converts hours to seconds), JMP datetimes are in seconds so you want to convert your hours to seconds and let JMP handle the formatting from that)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1704745410479.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/60229i7709661B27D318CE/image-size/large?v=v2&amp;amp;px=999" role="button" title="jthi_1-1704745410479.png" alt="jthi_1-1704745410479.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You can also change the format to Best to see the "real" underlying value (seconds).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2024 20:27:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Counting-values-in-column/m-p/714209#M89756</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-01-08T20:27:56Z</dc:date>
    </item>
  </channel>
</rss>

