Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Flag rows based on another field value

Hi everyone,

I am interested in looking at sets of rows with common account numbers, and assigning a 1 to a field in these rows if another field is true in any of these rows. To be more specific, I have fields called [Account Number], [field1] and [Production Date] - there are several rows for each Account Number since there's one for each production date. I need to figure out an efficient way to determine if field1 is ever true for each Account Number's set of rows and if so, I would like to assign a 1 to a field2 for every single one of those account numbers.

Basically this would flag every row for each Account Number that once contained a 1 in field1. Does anybody know how this could be done in the script or in the actual worksheet?

Thank you.

1 Solution

Accepted Solutions
Not applicable

Re: Flag rows based on another field value

I believe this is what you are looking for.

The expression will be like : field2=rangesum(above(if(aggr(max ( f1),Ano)=1,1,0),0,RowNo())).

I have attached the sample I used to come up with the result.

I ahve a productiondate, f1 (field1) and Ano (AccountNo). You can see the field 2 result in the chart,

Please let me know if this helps.

1 Reply
Not applicable

Re: Flag rows based on another field value

I believe this is what you are looking for.

The expression will be like : field2=rangesum(above(if(aggr(max ( f1),Ano)=1,1,0),0,RowNo())).

I have attached the sample I used to come up with the result.

I ahve a productiondate, f1 (field1) and Ano (AccountNo). You can see the field 2 result in the chart,

Please let me know if this helps.