Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
kakani87
Specialist
Specialist

Scripting - Load Data According to given input file data

Dear Folks ....

I would like to know the approach for achievement of a requirement.

Am having a sale table with me followed by Invoice number in that

Data should be loaded according to the input given by user

lets say with in all the invoice numbers available i want to load for only inv_no = 01,02,10,30 records from database while loading, if user gives 02,23,35 ... then consider as given from a file given by user.

Here I/p file may be .txt or .csv.

The way i know to load such kind of data using a where condition, but all the time this approach is not applicable when the count is higher in No of input values.

Hope someone can help me out of this.

Regards,

Kakani.

stalwar1

mbaeyens

tresesco

1 Solution

Accepted Solutions
olivierrobin
Specialist III
Specialist III

hello

and what about this scenario ?

load InvoiceNumber from UserFile

load ..... from DataFile where exists(InvoiceNumber)

?

where UserFIle is the file given by the user and containing the desired InvoiceNumbers

View solution in original post

6 Replies
balabhaskarqlik

May be like this:

If you want to enter value for region dynamically by user input. Try like this

Let vInvoiceNo = Input('Enter Invoice', 'Input box');

InvoiceInfo:

Load * from yourtable Where Invoice = '$(vInvoiceNo)';

While reloading, its ask user to enter Invoice Number.  And it display those Invoice Number information alone.

kakani87
Specialist
Specialist
Author

You mean to say dynamic filter using input box with assigning a variable  to that ?

If so,let me explain about that  i want to load only particular records based on the file provided by user.

lets say we have N no of transactions and among them user wants few transactions of data only to be displayed while loading/Fetching from database based on the user list of transactions to consider. 

Can we load only the invoice no's from a file given.

balabhaskarqlik

May be You can load all the data, but create a temp table to exclude those UN-necessary records.

settu_periasamy
Master III
Master III

Hi,

May be check this ..

Create one variable for providing Input values. Like

vInput_Invoice 


In the script,

Let vReplace_Invoice=Replace(vInput_Invoice,',','|');

Temp_Input:
LOAD Subfield('$(vReplace_Invoice)' ,'|') as Inv_Number AutoGenerate 1;

Sales:
LOAD * Where Exists(Inv_Number);

DROP Table Temp_Input;

Capture.JPG

olivierrobin
Specialist III
Specialist III

hello

and what about this scenario ?

load InvoiceNumber from UserFile

load ..... from DataFile where exists(InvoiceNumber)

?

where UserFIle is the file given by the user and containing the desired InvoiceNumbers

View solution in original post

kakani87
Specialist
Specialist
Author

Thanks a bunch Robin.

This worked perfectly.

Posting A sample to help other people like me.

User_ip:

LOAD Invoice

FROM

..\include\InPut_data.xlsx

(ooxml, embedded labels, table is Sheet1);

sales:

LOAD Invoice,

     TEXT(Branch) AS Branch,

     Qty,

     Value

FROM

..\include\Sale_sample.xlsx

(ooxml, embedded labels, table is Sheet1)

Where Exists(Invoice)

;