Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rupaliqlik
Creator
Creator

Compare Previous and Current row

Hi,

I want to calculate a flag where  previous row and current row is same then give 'matched' else 'unmatched' in qlikview back end script.So when I select Flag as Matched I will get only those material no whose sales are matched .

Material Report Sales_New
000002FSQlikview3510
Shad3640
4A3055Qlikview1275
Shad1275
9094200Qlikview11352
Shad11352
4 Replies
Michiel_QV_Fan
Specialist
Specialist

Make sure your data is sorted right. Then use previous function (all in the script)

If(previous(Sales_new) = Sales_new, 'Matched', 'Unmatched') as Flag

Anil_Babu_Samineni

Is that value you need by Material?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
jyothish8807
Master II
Master II

Try like this:

Load

Material,

Report,

Sales_New,

if(previous(Material)=Material and previous(Sales_New)=Sales_New, 'Matched', 'Unmatched') as Flag

from <>

order by Material;


Br,

KC

Best Regards,
KC