Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
Hi,
You can use Dynamic Update option in Qlikview to insert records from UI.
Refer link https://community.qlikview.com/thread/45050
Regards,
Pankaj
Hi,
As a record in the data warehouse of QlikView you can not insert from UI. Only by downloading the script.
Regards,
Andrey
Strictly speaking, you could:
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
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
Hi,
You can use Dynamic Update option in Qlikview to insert records from UI.
Refer link https://community.qlikview.com/thread/45050
Regards,
Pankaj
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.
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
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
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
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.