cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-479361%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%E7%95%B0%E3%81%AA%E3%82%8B%E3%83%91%E3%82%BF%E3%83%BC%E3%83%B3%E3%82%92%E5%90%AB%E3%82%80%E5%90%84%E3%82%BB%E3%83%AB%E3%81%AE%E5%90%88%E8%A8%88%E3%82%A2%E3%82%A4%E3%83%86%E3%83%A0%E3%82%92%E3%82%AB%E3%82%A6%E3%83%B3%E3%83%88%E3%81%99%E3%82%8B%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-479361%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3E%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%E3%80%81%3CBR%20%2F%3E%E8%A8%AD%E5%AE%9A%E5%88%97%E3%81%AE%E3%82%BB%E3%83%AB%E3%81%AE%E3%82%A2%E3%82%A4%E3%83%86%E3%83%A0%E3%81%AE%E5%90%88%E8%A8%88%E6%95%B0%E3%82%92%E5%8F%96%E5%BE%97%E3%81%97%E3%81%9F%E3%81%84%E3%81%A7%E3%81%99%E3%80%82%3A%E8%A8%AD%E5%AE%9A%E5%88%97%E3%81%AE%E5%80%A4%E3%82%92%E5%8F%96%E5%BE%97%E3%81%97%E3%80%81%3A%E5%90%88%E8%A8%88%E3%82%A2%E3%82%A4%E3%83%86%E3%83%A0%E3%81%AE%E4%B8%8B%E3%81%AB%E8%A1%A8%E7%A4%BA%E3%81%95%E3%82%8C%E3%82%8B%E3%82%88%E3%81%86%E3%81%AB%E5%90%88%E8%A8%88%E6%95%B0%E3%82%92%E3%82%AB%E3%82%A6%E3%83%B3%E3%83%88%E3%81%99%E3%82%8B%E3%82%B3%E3%83%BC%E3%83%87%E3%82%A3%E3%83%B3%E3%82%B0%E6%96%B9%E6%B3%95%E3%82%92%E6%95%99%E3%81%88%E3%81%A6%E3%81%8F%E3%81%A0%E3%81%95%E3%81%84%E3%80%82%E3%82%88%E3%82%8D%E3%81%97%E3%81%8F%E3%81%8A%E9%A1%98%E3%81%84%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22dadawasozo_0-1649977351362.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22dadawasozo_0-1649977351362.png%22%20style%3D%22width%3A%20281px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F41739i8B4402E40AD604CB%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22dadawasozo_0-1649977351362.png%22%20alt%3D%22dadawasozo_0-1649977351362.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-479361%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CLINGO-LABEL%3E%E6%B6%88%E8%B2%BB%E8%80%85%E3%81%8A%E3%82%88%E3%81%B3%E5%B8%82%E5%A0%B4%E8%AA%BF%E6%9F%BB%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3E%E5%A4%A7%E9%87%8F%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%9E%E3%82%A4%E3%82%BA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-479441%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%EF%BC%9A%E7%95%B0%E3%81%AA%E3%82%8B%E3%83%91%E3%82%BF%E3%83%BC%E3%83%B3%E3%82%92%E5%90%AB%E3%82%80%E5%90%84%E3%82%BB%E3%83%AB%E3%81%AE%E5%90%88%E8%A8%88%E3%82%A2%E3%82%A4%E3%83%86%E3%83%A0%E3%82%92%E3%82%AB%E3%82%A6%E3%83%B3%E3%83%88%E3%81%99%E3%82%8B%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-479441%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E3%81%93%E3%82%8C%E3%81%8C%E3%80%81%E7%A7%81%E3%81%8C%E6%80%9D%E3%81%84%E3%81%A4%E3%81%84%E3%81%9F%E3%80%8C%E3%82%A2%E3%82%A4%E3%83%86%E3%83%A0%E3%81%AE%E5%90%88%E8%A8%88%E3%80%8D%E5%88%97%E3%81%AE%E5%BC%8F%E3%81%A7%E3%81%99%E3%80%82%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Ecount%20%3D%200%3B%0Ai%20%3D%201%3B%0AWhile(%20Word(%20i%2C%20%3Asetting%2C%20%22%2C%22%20)%20!%3D%20%22%22%2C%0A%20theWord%20%3D%20Word(%20i%2C%20%3Asetting%2C%20%22%2C%22%20)%3B%0A%20If(%20Contains(%20theWord%2C%20%22-%22%20)%20%7C%20Contains(%20theWord%2C%20%22%3A%22%20)%2C%0A%20%20Show(%20Row()%2C%20theWord%20)%3B%0A%20%20count%20%3D%20((count%20%2B%20Num(%20Word(%202%2C%20theWord%2C%20%22-%3A%22%20)%20))%20-%20Num(%20Word(%201%2C%20theWord%2C%20%22-%3A%22%20)%20))%20%2B%201%3B%0A%20%2C%0A%20%20count%0A%20%20%2B%2B)%3B%0A%20i%2B%2B%3B%0A)%3B%0Acount%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
dadawasozo
Level IV

counting total item in each cell that contain different pattern

Hi,
I want to get the total count of the item in the cell under setting columns. Can someone give me suggestion how I can code it so it will take the value under :setting column and count the total number like what shown under :Total Items. Many Thanks.

dadawasozo_0-1649977351362.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: counting total item in each cell that contain different pattern

Here is the formula for the column Total Items, that I came up with.

count = 0;
i = 1;
While( Word( i, :setting, "," ) != "",
	theWord = Word( i, :setting, "," );
	If( Contains( theWord, "-" ) | Contains( theWord, ":" ),
		Show( Row(), theWord );
		count = ((count + Num( Word( 2, theWord, "-:" ) )) - Num( Word( 1, theWord, "-:" ) )) + 1;
	,
		count
		++);
	i++;
);
count;

 

Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: counting total item in each cell that contain different pattern

Here is the formula for the column Total Items, that I came up with.

count = 0;
i = 1;
While( Word( i, :setting, "," ) != "",
	theWord = Word( i, :setting, "," );
	If( Contains( theWord, "-" ) | Contains( theWord, ":" ),
		Show( Row(), theWord );
		count = ((count + Num( Word( 2, theWord, "-:" ) )) - Num( Word( 1, theWord, "-:" ) )) + 1;
	,
		count
		++);
	i++;
);
count;

 

Jim
dadawasozo
Level IV

Re: counting total item in each cell that contain different pattern

This is amazing! I was only able to do one type str count. I learn new thing. Thanks a lot.

Recommended Articles