Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi I HAVE TABLE LIKE
Products:
apple
banana
orange
mango
when i go for load into qlikview
table1:
load
products
from xl sheet; fine up to here
now if i go for peek here
table1:
load
products
peek('products',-1,'table1') as new
from xl sheet;
now i am getting in new field
new:
mango
my question is peek will use for only one value ?
i want in loop format like it has return apple,banana,mango,orange all how to do it ?
This works for me :
data:
LOAD * INLINE [
Products
apple
banana
orange
mango
];
table1:
load
Products,
peek('Products',-1) as new
Resident data;
The second parameter means: start from the end -1 so you have mango. If you use RowNo() instead of -1 the result should change
Hi CommonQlik,
Use a function or a varible in the second parameter:
Random solution:
table1:
load
products
peek('products',Floor(rand()*4),'table1') as new /*There are 4 fruits in your table)*/
from xl sheet;
I search an Index solution...
François
Hi,
You have to iterate the peek function from
table1:
LOAD * INLINE [
products
apple
banana
orange
mango
];
let vNoofRows = NoOfRows('table1');
Data:
LOAD
products,
peek('products',IterNo(),'table1') as new
FROM
[Data\Test.xlsx]
(ooxml, embedded labels, table is Sheet1) While IterNo() <= $(vNoofRows);
But you can use Mapping load here rather than peek if you have two fields.
Regards
Anand
please define your expected result.
I'm not sure that peek will give you your desired result.
How about
table1:
load
products
from xl sheet;
LEFT JOIN (table1)
LOAD concat(DISTINCT products, ',') as new
RESIDENT table1;
here my doubt is
can we use peek in loaded table or
we need to take resident have to use ?
is it same for previous function ?
Hi,
I would have to agree with Marco. What are you trying to do and what is the expected results. Peek is normally used to pull data from a certain row in a table.
Bill
Hi,
Provide any sample data or expected output that what is your output then it will easy to understand the problem.
Regards
Anand