Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Partner
Partner

Compare two rows in straight table

Hi All,

In the below mentioned table ,I want to compare SQ number row by row. For eg: 

first row of sq number is 19200002 then the first row of above column should show No because sq number doesn't have any previous row.

Second row of above column should show 'Yes' because second row and its previous row of column SQ Number are same.

likewise third row and fourth row should show' Yes'.

Fifth row should show 'NO'.

I have attached the full data table. I have applied above and below function in front end but its not working.

=if(SQ Number =Above(SQ Number),'Yes','No')

SQ NumberAboveOMS ReferenceBusiness PointLine of BusinessLOB
 No    
19200002NoMMR/GR/18/8505D102T02SLD
19200002NoMMR/GR/18/8505D102T02SLD
19200002NoMMR/GR/18/8505D102TBDPSLD
19200002NoMMR/GR/18/8505D102TCBDPSLD
19200005NoBGD/DP/18/8455D00201FLD
19200005NoBGD/DP/18/8455D00201FLD
19200005NoBGD/DP/18/8455D00201FLD
19200005NoBGD/DP/18/8455D00201FLD
19200005NoBGD/DP/18/8455D00201FLD
19200005NoBGD/DP/18/8455D00201FLD
19200005NoBGD/DP/18/8455D00201FLD
19200005NoBGD/DP/18/8455D00201FLD
19200005NoBGD/DP/18/8455D00201FLD
19200005NoBGD/DP/18/8455D00201FLD

 

Thanks in advance

1 Solution

Accepted Solutions

Re: Compare two rows in straight table

May be you have multiple dimensions and you need to use TOTAL keyword here?

=If([SQ Number] = Above(TOTAL [SQ Number]), 'Yes', 'No')
3 Replies
vijetasharma
Valued Contributor

Re: Compare two rows in straight table

try to use Previous().

In new table you can load [SQ Number] and create Previous([SQ Number]) as SQN1 from resident table

and then in straight table add expression as =if([SQ Number]=SQN1,'Yes','No').

 

 

Re: Compare two rows in straight table

May be you have multiple dimensions and you need to use TOTAL keyword here?

=If([SQ Number] = Above(TOTAL [SQ Number]), 'Yes', 'No')
Partner
Partner

Re: Compare two rows in straight table

Thank you Sunny!  it's working