Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

how to insert record from UI

I'd like to build a what if tool, I know we can use INPUTFIELD to modify existing record values with table box, but what if I want to add new record instead of adjusting existing one, what is in my mind is that we can place an input box for each column, user can manually input the value and click "Add" and insert this new record in existing table, how can I achive this? Thanks.

1 Solution

Accepted Solutions
Highlighted
Specialist
Specialist

Re: how to insert record from UI

Hi,

You can use Dynamic Update option in Qlikview to insert records from UI.

Refer link https://community.qlikview.com/thread/45050

Regards,

Pankaj

View solution in original post

16 Replies
Highlighted
Master
Master

Re: how to insert record from UI

Hi,

As a record in the data warehouse of QlikView you can not insert from UI. Only by downloading the script.

Regards,

Andrey

Highlighted
Partner
Partner

Re: how to insert record from UI

Strictly speaking, you could:

  • have the user input the new value into an input box
  • have the "add" button (partially) reload the document
  • load the variable (set by the input box) into your table as a new record

Naamloos.png

Fruit:

LOAD

     Fruit,

     Color

FROM

fruit.qvd

(qvd);

Concatenate(Fruit)

LOAD * INLINE [

    Fruit, Color

    $(vFruit), $(vColor)

];

Store Fruit into fruit.qvd;

I've attached my demo. I hope it helps you.

With kind regards,

Ronald

Highlighted
Master
Master

Re: how to insert record from UI

Hi Qiang,

As Ronald says you CAN add a record to your data model but as Andrey says you CANNOT add a record to the source database.

So when you talk about adding a new record, to what do you want to add the record to?

Regards

Andrew

Highlighted
Specialist
Specialist

Re: how to insert record from UI

Hi,

You can use Dynamic Update option in Qlikview to insert records from UI.

Refer link https://community.qlikview.com/thread/45050

Regards,

Pankaj

View solution in original post

Highlighted
Specialist
Specialist

Re: how to insert record from UI

Hi effinty2112

You can add records to a datasource using a SQL Statement, INSERT or UPDATE. But I don´t know if this is what qiangs_2017‌ want to do.

Highlighted
Master
Master

Re: how to insert record from UI

Hi Jose,

You're correct of course and I hesitated before saying "CANNOT" but going down that route is not for the fainthearted and takes us away from standard QlikView functionality. Although QV can run macro scripts I consider that stepping outside of QV.  You may disagree. If you write a script that successfully executes SQL commands on the source database using variables from the QV app without the user leaving QV then you have justification in taking a different point of view.

I have a couple of apps that do update flags on a SQL Server database but adding new records is something I would never do from within QV, but that's just my view and I can't say that you're wrong.

Kind regards

Andrew

Highlighted
Specialist
Specialist

Re: how to insert record from UI

Of Course effinty2112, Qlikview is not a tool to modify SQL databases, there are a lot of tools that do it better. I never INSERT in a database from QV (only UPDATE flags as you).

I don't know what our colleague exactly need, maybe he needs to write in a table when the Qlik app is connected to the database as a log, then he can do it with Qlik.

As all the best practices rules and programming patters, you can not to follow step by step if is necessary in your development.

Regards

Highlighted
Not applicable

Re: how to insert record from UI

hi Ronald,

this is the exact case I need to deal with, this is my first idea in my mind to append the data into QVD and reload, but it is a heavy operation if the volume is big, is there any smarter way we can try?

btw your demo doesn't work for me, I tried to add some fruit but the table remained the same.

Thanks

-Stan

Highlighted
Not applicable

Re: how to insert record from UI

I agree, modifying database within QV is not good idea,I prefer changing inside of QV(memory) for "what if" purpose, I don't need to store the changes back to original source.