Discussion Board for collaboration on QlikView Scripting.
I have a Scenario, could some one help me how to do it using Qlikview.
In the attached file, I have 3 columns to determine the result column. Please let me know whether we can do this using scripting or as a expression.
If the first ID and the ID in the next line matches, Version is 1, Order is A and the next order is B or D then Result is Fruit.
else if the version number in next row is summation of Version+1 and order is C and Order in next line is B then it is a Vegetable else Salads.
ie: as per example quoted here,
if (100 =100 (Next Line), If(Version=1 and Order=A and Order(Next Line)=B or D, 'Fruits',
if(Version(Next Line)= Version+1 and Order=C and Order(next Line)=B,'Vegetables'),'Salads').
How can i fetch the next line data of a column? Can someone solve this?
Is it best to use expressions in straight table or is there a way to do it via scripting?
Go to Solution.
load * inline [
ID, Version, Order, Result
if(ID=Previous(ID) and Previous(Version)=1 and Order='A' and match(Previous(Order),'B','D'), 'Fruit',
if(Previous(Version)=(Version+1) and Order='C' and Previous(Order)='B', 'Vegetables',
)) as NeweResult
order by ID desc, Version desc, Order desc;
DROP Table source;
Reverse the order of the records with an Order By clause and then use the Previous() function.
Thank you.. It was helpful