Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Join us for a live Q&A! September 21, 10 AM ET - Onboarding Fast in Qlik Sense SaaS! REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
beck_bakytbek
Master
Master

Adopt the specific values with function: peek()

Hi Folks, 

i got a question, is that possible to use the peek () to get only specific values, for example, my data do look like:

CostcenterProjectStatusNewStatus
GermanyA22openopen
USAA22closedclosed
TaiwanA22unknownopen

 

As you see, Status of Taiwan is 'unknown', i want to replace the 'unknown' only by value of Costcentrer of Germany, my expected Value is NewStatus for Taiwan = open,

if i use the function: peek() so i get the value of USA, what is wrong in this context, i want to replace the 'uknown' only by the value of first row.

Does anybody have any idea, how to rectify this issue?

Thanks a lot

Bek

Labels (1)
2 Replies
chriscammers
Partner
Partner

Your question is a little light on details but from what I surmise you want to create a new field with replacing all the values with "unknown" to "Open"

This is very simple with the If() function


If(Status = 'Unknown','Open',Status) as NewStatus​

You were asking about peek which will allow you to get the value from a field based on the row number you request. Keep in mind the row numbers used in peek begin with 0, your example indicates you were using a 1 as the row number. If what I have mentioned does not help please post some code so we can see what you are doing an better understand the requirements.

beck_bakytbek
Master
Master
Author

Hi Chriscammers thanks a lot for your time and help,

my situation does look like:

Costcenter  Project       Status     NewStatus
Germany      A22              open        open
USA                A22              closed     closed
Taiwan         A22            unknown   open
Germany     A23                 open    cancelled
USA               A23               closed      closed
Taiwan        A23             unknown  cancelled


I would like to fill the field with 'unknown' always with the content of the field: Germany. 

I hope I was able to explain it, if not, please let me know. Thank you again for your help and your precious time.

Bek