Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
ysalvi
Contributor II
Contributor II

Help in logic development

Hello Team,

Required some help in logic development in the backend script, my requirement is to compare the current record with respect to above record, Please find example below 

Column A, B are input for me required Column C as output 

ysalvi_0-1703149116452.png

 

Thanks in advance 

Labels (2)
4 Replies
vincent_ardiet_
Specialist
Specialist

ysalvi
Contributor II
Contributor II
Author

Hello @vincent_ardiet_ 

Have tried this but it is  not working because the output is coming below 

ysalvi_0-1703222924273.png

Thanks in advance 

 

 

vincent_ardiet_
Specialist
Specialist

you can change the sort order of your table

Fabiano_Martino_Intelco
Partner - Creator II
Partner - Creator II

Hi @ysalvi ,

I got the expected result with this code:

 

Base_Table:
LOAD * INLINE [
A, B
    ABC, ABC-1
    ABC, ABC-2_1
    ABC, ABC-2_2
    ABC, ABC-3
];
 
Result_Table:
Load
A as A_Result,
    B as B_Result,
    Peek('B', RowNo(), 'Base_Table') as [Modified B]
Resident Base_Table;

 

@vincent_ardiet_ is also right, if you can sort the table you can use the previous() function.

Regards