Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
rajni_batra
Specialist
Specialist

Problem with Peek()

hello frndz,

i have a scenario lyk

Booking IDApproval CodeTransaction Date=sum([Collection Amount])=sum(ECouponAmount)





NF2101322199095
08-10-20121634100
NF2101322199095
03-11-2012249100
NF2101322199095BYPASS04-10-20120100
NF210132219909501923308-10-2012975100

here ECoupan is coming 4 times for same id but i want it only once for the first transaction only

i have used expression

if(Peek([Document No_])<>[Document No_],ECouponAmount,'0') as ECouponAmount,

if(previous([Document No_])<>[Document No_],ECouponAmount,'0') as ECouponAmount,

but not giving the desired output, plz help

2 Replies
Not applicable

Hi,

Maybe you should do the Peek with -Booking ID:

e.g :

LOAD

          *,

          if(Peek([Booking ID])<>[Booking ID],ECouponAmount,'0') as ECouponAmountFinal;

LOAD * INLINE [

    Booking ID, Approval Code, Transaction Date, Collection Amount, ECouponAmount

    NF2101322199095, , 08/10/2012, 1634, 100

    NF2101322199095, , 03/11/2012, 249, 100

    NF2101322199095, BYPASS, 04/10/2012, 0, 100

    NF2101322199095, 19233, 08/10/2012, 975, 100

];

Anonymous
Not applicable

You may need to relad the table first, with an Order By clause, to make sure it is in the expected order.

Jonathan