
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
usage of Peek Function
Hi guys,
i have these data
I want to fetch the first value "yaman" by giving the value of key which "Person"
How can i do it using Qlik sense script.
- Tags:
- function
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sort your table in ascending/descending order of your field ID and then use Peek() function

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to fetch the first value "yaman" by giving the value of key which "Person"
Not sure I understand this statement of yours?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May be like this
LOAD Key,FirstValue(Value) as Value
From Table
Group By Key;
An example :
LOAD Key,FirstValue(Value) as Value Inline [
Key,attribute,Value
Person,Name,Yaman
Person,Surname,Alsaadi
Person,Age,30
Person,Salary,1000
Car,Engine,Crome
Car,Model,2010
Car,Color,Red
]Group By Key;


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
TABLE:
LOAD * INLINE [
KEY,ATTRIBUTE,VALUE
PERSON,NAME,YAMAN
PERSON,SURNAME,ALSAADI
PERSON,AGE,30
PERSON,SALARY,1000
CAR,ENGINE,CROME
CAR,MODEL,2010
CAR,COLOR,RED
];
LET vName=PEEK('VALUE',0,'TABLE');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i mean i have the value "Person" and i want to know the value of the same row under Value field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is antoniotiman solution not working for you?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
it is working just for previous example but if i do not know in which row the key is how can determine the middle parameter in peek function which is the previous example 0

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What do you mean when you say that you don't know which row the key is? I am not sure I understand the whole logic you are trying to implement here

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
from the following data :
if i have the first ID whixh is 00000000-0000-0000-0000-000000000000 and i want to get the value of the Name which is "Battle"
How can i do it using Peek function but if i do not know the location of this record (only in this example the record in the first row) . i now only the value of ID
so what will be the middle parameter of the peek function !!!

- « Previous Replies
-
- 1
- 2
- Next Replies »