Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to load only records within a specific range from a csv file into a oracle table

Hi Guys,

I have a requirement where there is a csv file as input for example consider its having 1000 records

with the below schema

 

emp_name,emp_sal,emp_city

xyz,1000,hyderabad

abc,2000,delhi

mnp,3000,bangalore

 

I have to load the data into a oracle table but only specific records within a range
(ex : 200 to 350,500 to 875,etc) I need to give the range at run time using context variables.

how can I achieve that?
does tFileRowCount supports that or is there any solution??

quick reply would be appreciated

 

 

Labels (3)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

Sorry for the mistake, this one works:

new String (context.From + ".." + context.To)

 

View solution in original post

13 Replies
TRF
Champion II
Champion II

Have a look to tSampleRow
Anonymous
Not applicable
Author

Hi,

Thanks for the reply.

I had a look at tSampleRow component but in this we have to hard code the values which i don't want to.

But my requirement is I need to specify the range dynamically when the job runs.

Today I have a req to load records between 300 to 400 . 

tomorrow the req can be to load between 600 to 900,etc like this.

 

So how can I achieve this??

Anonymous
Not applicable
Author

Hi,

Please find attached screenshot of my job. I tried using context variables prompting them at run time for the range values. still its not giving the output


samplerow.PNG
Anonymous
Not applicable
Author

Hi,

PFA screenshot.

Please if any one knows let me know where I'm doing wrong?
I tried to display the values of context variables and they are getting displayed on the console but none of the rows are moving to tlogrow from tsamplerow

TRF
Champion II
Champion II

context.From+".."+context.To

may the better is to have a single context variable like context.Interval so you can define the desired interval as you want such as:

100..200,500..1000,1500,2000

Should work

 

Anonymous
Not applicable
Author

Hi,

I tried as you told like keeping the expression

context.from+".."+context.to in tSampleRow and I got the above error.

PFA screenshot for the error.
both the context variables are of type Integer.

 

Please let me know for any details.


3.PNG
Anonymous
Not applicable
Author

Hi,

Could you please let me know the solution asap.

 

Thanks in advance

TRF
Champion II
Champion II

Sorry for the mistake, this one works:

new String (context.From + ".." + context.To)

 

Anonymous
Not applicable
Author

Hi,

Sorry It didn't work.

PFA screenshot.

 

tJavaRow      code : context.interval = new String(context.from+".."+context.to);

tSampleRow code : context.interval

 

All the 3 variables are of type String

But still it didn't resolve my issue.


4.PNG