Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, Im new to qlik sense and using the button widget. I would like to have a button that execute a part of the script in the Data Load Editor to update a QVD.
I am trying to execute the script below:
"NewMilestones_QVD:
Load
Rank,
Ranking,
if(Rank = Priority, Priority, Rank) as Priority,
Milestone,
FROM [lib://RPA HuNTx Analytics QVD Store/Milestone_Test.qvd]
(qvd);
Store NewMilestones_QVD into [lib://RPA HuNTx Analytics QVD Store/Milestone_Test.qvd]
(qvd);"
In the button I used: "$(must_include=$(vPartialReloadScript))"
In the Data Load Editor I used:
"SET vPartialReloadScript = '
NewMilestones_QVD:
Load
Rank,
Ranking,
if(Rank = Priority, Priority, Rank) as Priority,
Milestone,
FROM [lib://RPA HuNTx Analytics QVD Store/Milestone_Test.qvd]
(qvd);
Store NewMilestones_QVD into [lib://RPA HuNTx Analytics QVD Store/Milestone_Test.qvd]
(qvd);
';"
Not sure if this is the best way to go about this, any assistance is appreciated. Thank you.
hi @Asuod_
your button onle need this
The important thing is that in your script you identify those parts that you want to be executed only when a partial reload is executed
the following script will execute only in standar reload
NewMilestones_QVD:
Load
Rank,
Ranking,
if(Rank = Priority, Priority, Rank) as Priority,
Milestone,
FROM [lib://RPA HuNTx Analytics QVD Store/Milestone_Test.qvd](qvd);
Store NewMilestones_QVD into [lib://RPA HuNTx Analytics QVD Store/Milestone_Test.qvd](qvd);
this one will execute on standar and partial reload
NewMilestones_QVD:
add Load
Rank,
Ranking,
if(Rank = Priority, Priority, Rank) as Priority,
Milestone,
FROM [lib://RPA HuNTx Analytics QVD Store/Milestone_Test.qvd](qvd);
Store NewMilestones_QVD into [lib://RPA HuNTx Analytics QVD Store/Milestone_Test.qvd](qvd);
and this only in partial reload
NewMilestones_QVD:
add only Load
Rank,
Ranking,
if(Rank = Priority, Priority, Rank) as Priority,
Milestone,
FROM [lib://RPA HuNTx Analytics QVD Store/Milestone_Test.qvd](qvd);
//without this IF, the STORE will return error on partial reloads
IF IsPartialReload() THEN
Store NewMilestones_QVD into [lib://RPA HuNTx Analytics QVD Store/Milestone_Test.qvd](qvd);
ENDIF;
also, remember you can set Partial reload in QMC
Hope this helps,
help users find answers! Don't forget to mark a solution that worked for you & to smash the like button!
hi @RafaelBarrios, thank you for the reply. The script you provided worked i used the partial reload but it caused duplicates.
So right now i have a vizlib writeback table which i can change values and update the QVD but im looking to have another button to run a partial reload to make changes to the QVD as well. I have attached picture of the dashboard. The "Priority" column you are able to edit but with the writeback it allows you to select duplicate values, what im trying to do is when they hit the partial reload at the top then it takes the "Ranking" value and replaces the "Priority" value so there are no duplicates.
Writeback Script:
let vFileName = 'Milestone_Test.qvd';
let vFileExists = FileTime(vFileName);
LET vScriptErrorDetails = ScriptErrorDetails;
IF vScriptErrorDetails <> Null() THEN
EXIT SCRIPT;
END IF;
IF vFileExists THEN
VizlibWritebackTable:
REPLACE LOAD
*
From "lib://Milestone_Test.qvd" (qvd, utf8);
ELSE
VizlibWritebackTable:
REPLACE LOAD
*
Inline [
'Ranking','Rank','Priority','Milestone','Milestone_count'
];
LET vScriptErrorDetails = ScriptErrorDetails;
IF vScriptErrorDetails <> Null() THEN
EXIT SCRIPT;
END IF;
END IF
Partital Reload:
NewMilestones_QVD:
add only Load distinct
Milestone,
Rank,
Ranking,
if(Ranking = Priority, Priority, Ranking) as Priority
FROM [lib://Milestone_Test.qvd](qvd);
//without this IF, the STORE will return error on partial reloads
IF IsPartialReload() THEN
Store NewMilestones_QVD into [lib://Milestone_Test.qvd](qvd);
ENDIF;