cancel
Showing results for 
Search instead for 
Did you mean: 

Variable 'Where' Question

0 Kudos

Looking for a solution to allow for a count of rows based on specific text from a variable in the row.

=If([Order]) InList ("Text1"; "Text2"; "Text3") Then ([Detail Line]) - This returns the specific line text

=If([Order]) InList ("Text1"; "Text2"; "Text3") Then Substr ([Detail Line];20;55) - This returns the text withing the line

=Substr ([Detail Line];1;Pos ([Detail Line];",")-1) - This returns only the text needed at the comma

For testing I added a row count, Line count and a count.

=RunningCount([DT/Tm];([CustNumber])) - This is the Row Count

=RunningCount(LineNumber();([CustNumber])) - This is the line count (returns the same as the Row Ct)

=Sum([RowCt]) Where([ct]=2) ForEach([CustNumber]) - Returns a 1 for every row where there is a row count of 2.

I then need to count the rows where the text from the detail line changes from row 1 to row 2. As an example, if row 1 is Green and Row 2 is Red then 1. If Row 1 is Green and Row 2 is Green then 0. If Row 1 is Black and Row 2 is Orange then 1. Basically the text in each row changes for each order. A separate variable would be needed for each text change.

I think that the Where function is needed but are unclear on the syntax. Is this possible?

Accepted Solutions (1)

Accepted Solutions (1)

saurabh_sonawane
Active Contributor
0 Kudos

use a previous function to handle the above logic

step 1 create a variable to check whether the previous variable is same or not if not same the show 1

If(test = pervious(test) ; 0 ; 1)

then take a count of above variable

Answers (1)

Answers (1)

0 Kudos

Excellent! Thanks for the assistance.