Hello everybody, I'm new to qlikview,
I need to create a flag field for customers who have used the same product in the last two months.
in my load, I created a temporary table and thought of using the peek function, for her to check and create the flag for me. However, it's not working:
TEMP__1:
LOAD NR_CLIENT,
DT_INT_DISP,
DT_FINISH_DISP,
RowNo()
RESIDENT CLIENT_PRODUCT_DISP
WHERE NR_SEQ_PRODUCT=1
ORDER BY NR_CLIENT,
DT_INT_DISP ASC;
TEMP_2:
LOAD NR_CLIENT,
DT_INT_DISP,
DT_FINISH_DISP,
IF(NR_CLIENT=PEEK(NR_CLIENT),
IF(DT_INT_DISP-PEEK(DT_FINISH_DISP),-2)'YES','NO'),'NO') AS FL_CLIENT_2,
ROWNO(),
Resident TMP_1
Order by NR_CLIENT,
DT_INT_DISP ASC;