Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
vvvvvvizard
Partner - Specialist
Partner - Specialist

if model is run from qmc then else

Good day

How do i code the below

If a model was run from the QMC i would like to set the error mode =0 for that run ,

else if the model is not run from QMC set error model to 1.

This model is scheduled to run daily .

1 Solution

Accepted Solutions
m_woolf
Master II
Master II

You probably have a service account that is the user when an app is reloaded from the QMC.

If osuser() = YourServiceAccount then

     set errormode = 0;

else

     set errormode = 1;

end

View solution in original post

2 Replies
m_woolf
Master II
Master II

You probably have a service account that is the user when an app is reloaded from the QMC.

If osuser() = YourServiceAccount then

     set errormode = 0;

else

     set errormode = 1;

end

tschullo
Creator III
Creator III

I am running June 2020 Qlik Sense. this code seems to work for me.

vUser=SubField(osuser(),'UserId=',2);
If '$(vUser)' = 'sa_scheduler' then
set errormode = 0;
TRACE 'vUser = $(vUser)';
else
set errormode = 1;
TRACE 'vUser = $(vUser)'
end if;