Counting redundant rows using by variables - different outcome for continuous and nominal by variables?Here I am counting redundant rows based on info held in 2 columns (Batch ID & Value [concentration]).
Col Cumulative Sum( 1, :Batch ID, :"Value [concentration]"n )
However, based on whether Value [concentration] is formatted as continuous or nominal variable in my table, a different result is obtained (see screenshots below).
Outcome with Value [concentration] as continuous variable (not what I want)

Outcome with Value [concentration] as nominal variable B (what I want)

Is there some computational issue (missing values...?) I need to wrap my head around to understand this?
Thank you! (Btw, I still haven't figured out how to add JSL code with fancy colour coding to the forum despite using the button for this. Sorry.)
P.s.: I realize that it may appear nonsensical to count combinations of Batch ID and missing values, but there are practical reasons for this at the time of writing.
Data TableScriptingRe: Counting redundant rows using by variables - different outcome for continuous and nominal by variables?Some with more knowledge will have to provide correct answer why this is happening with numeric columns (your second example has Character column, not just Nominal numeric column), but you might be able to handle it depending on what you are doing by using something like:
Col Cumulative Sum( 1, :Batch ID, Col Stored Value(:"Value [concentration]"n ))
or
Col Cumulative Sum( 1, :Batch ID, IsMissing(:"Value [concentration]"n ))
Re: Counting redundant rows using by variables - different outcome for continuous and nominal by variables?Yes, sorry for using incorrect terminology. I have revised that now in the original post.
I changed the concentration data temporarily to character format, since I know (from experience) that this is working.
Thank you for your reply!