Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Arianna1
Contributor II
Contributor II

Load data if

I'd been looking through Community about that but I couldn't find solution to my problem
From the logic:
if condition then
statement;
else statement;
end if

i would like to use as condition the load of at least one record from qvd file.
Any suggestions?

Thanks

Arianna

1 Solution

Accepted Solutions
Taoufiq_Zarra

if you want only load first record you can use :

TMP:
First 1 
LOAD Value
FROM ...

 

if you want test if else ...

suppose i have a qvd file with one field Value=1,2,3,4

i wan use if else to test the first record if its 1 or no

i can use if in load like this :

TMP:
First 1 
LOAD Value
FROM
YOURQVD.qvd
(qvd);

let firstvalue=peek('Value');

if '$(firstvalue)'=1 then
	let trace=1;
elseif '$(firstvalue)'<>1
	let trace=0;
	
end if

 

if i show the trace variable :

Capture.PNG

 

more detail Help

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

2 Replies
Taoufiq_Zarra

if you want only load first record you can use :

TMP:
First 1 
LOAD Value
FROM ...

 

if you want test if else ...

suppose i have a qvd file with one field Value=1,2,3,4

i wan use if else to test the first record if its 1 or no

i can use if in load like this :

TMP:
First 1 
LOAD Value
FROM
YOURQVD.qvd
(qvd);

let firstvalue=peek('Value');

if '$(firstvalue)'=1 then
	let trace=1;
elseif '$(firstvalue)'<>1
	let trace=0;
	
end if

 

if i show the trace variable :

Capture.PNG

 

more detail Help

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Arianna1
Contributor II
Contributor II
Author

thanks for the kindness

Arianna