Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Need help to get below output in OUT PUT column in qlik script.(creating new column)
ID | Status | Name | OUT PUT |
111 | NO | ||
111 | NO | ||
111 | NO | jone | jone |
111 | NO | jone | |
111 | NO | jone | |
111 | NO | jone | |
111 | NO | jone | |
222 | NO | ||
222 | NO | ||
222 | NO | Lee | Lee |
222 | NO | Lee | |
222 | NO | Lee |
Try this
Table: LOAD RecNo() as RowNum, *, If(ID = Previous(ID) and Len(Trim(Name)) = 0, Peek('OUTPUT'), Name) as OUTPUT; LOAD * INLINE [ ID, Status, Name 111, NO, 111, NO, 111, NO, jone 111, NO, 111, NO, 111, NO, 111, NO, 222, NO, 222, NO, 222, NO, Lee 222, NO, 222, NO, ];
Created the above in QlikView, but will work in Qlik Sense as well.... here is sample image of what I get
You must tell us what is the logic behind getting those values in output field.
Regards,
Kaushik Solanki
Please use below syntax to create a new field.
if(Name<>peek(Name),Name) as New_Output
Try this
Table: LOAD RecNo() as RowNum, *, If(ID = Previous(ID) and Len(Trim(Name)) = 0, Peek('OUTPUT'), Name) as OUTPUT; LOAD * INLINE [ ID, Status, Name 111, NO, 111, NO, 111, NO, jone 111, NO, 111, NO, 111, NO, 111, NO, 222, NO, 222, NO, 222, NO, Lee 222, NO, 222, NO, ];
Created the above in QlikView, but will work in Qlik Sense as well.... here is sample image of what I get