Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Insert records through input box

Hi Experts,

I have this situation,

I have a table called 'Zipcodes' which has only one column zipcode. There are 10 zipcodes in the table(QVD) and there are displayed in the dashboard as a Listbox. I wish to add a zipcode through a input box and click on button 'Go', this should add the newly added zipcode to the existing table 'Zipcodes'.

Is it possible to create this situation?

Your help much appreciated.

Thank you.

1 Solution

Accepted Solutions
Not applicable
Author

Like this

This is my example Source file  (Run only first time)

// First time Start

Test:
Load * Inline [
Zip
1
2
3
4
]
;

Store Test into Zip.txt(txt);

// First time end

from second time onwards use this below script

 

Test:

LOAD Zip
FROM
Zip.txt
(
txt, utf8, embedded labels, delimiter is '\t', msq);


Load $(vInput)
as Zip

AutoGenerate 1;
Store Test into Zip.txt(txt);

Now in UI,

1. Create a variable called vInput and enter your value using inputbox

2. Take a Button object->Add action->Reload(Don't check on Preceeding load)

Hope it helps you..

View solution in original post

8 Replies
Not applicable
Author

Hi,

Take a variable in inputbox.

Check Listed values option in Constraint and write:

          =Concat(DISTINCT  zipcode,',')

Then select option Predefined values in drop-down.

PFA qvw file

Not applicable
Author

Like this

Not applicable
Author

Hey I am not able to open this qvw file I am using a personal edition...

Can you please help me with the script or the way to open it?

Not applicable
Author

Like this

This is my example Source file  (Run only first time)

// First time Start

Test:
Load * Inline [
Zip
1
2
3
4
]
;

Store Test into Zip.txt(txt);

// First time end

from second time onwards use this below script

 

Test:

LOAD Zip
FROM
Zip.txt
(
txt, utf8, embedded labels, delimiter is '\t', msq);


Load $(vInput)
as Zip

AutoGenerate 1;
Store Test into Zip.txt(txt);

Now in UI,

1. Create a variable called vInput and enter your value using inputbox

2. Take a Button object->Add action->Reload(Don't check on Preceeding load)

Hope it helps you..

Not applicable
Author

Thank you very much Ravi...

Appreciate your help and support...

I got what I needed. But I have a question here...

Is there a way to insert the record into the table without reloading the script? I am just curious to know because script loads thousands of records from the DB, it will take time if i do a reload. How about using partial reload in this case?

Can you please put some light on this.

Thank you.

Not applicable
Author

For your first question,

I think there is no way to insert the data into a table without reloading the application.

For your second question,

Myne is a sample file that's why i suggested you to reload.Because there you won't find any performance issue.

Yes, You can use Partial reload also, for this you need to use prefix "ADD" before Load.

In your case you can use partial load with only that field.

or

Reload only that field based on condition.

Note: I think it is ok, if you use Partial load/Reload for one field.

Not applicable
Author

Hi,

Can you please explain the above in little detail.

Thank you for your time.

sudeepkm
Specialist III
Specialist III

I've seen options or settings in QlikView User Preference and Script for write back to database. may be using some sort of extension or native object I'm not sure.I'll update you if I find anything. You may also look at the reference manual.

T113439.png