Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

QMC Reload vs Qlikview Desktop Reload

Can someone help me with the functions which identities the reload between QMC and Qlikview Dektop?

the requirement is i have to use two different databases  respectively for QMC and Qlikview Desktop reloads.

Thanks

Hari

13 Replies
micheledenardi
Specialist II
Specialist II

You can do something like this.

Suppose that your QMC reload start at 7am:

If hour(now(1))=7 then

    Connection to QMC Reload Database

else

    Connection to  QlikView Desktop Reload Database

End If

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
Anonymous
Not applicable
Author

Thank you, but i need to identify the difference.

tresesco
MVP
MVP

You can check the computer name using computername() and then decide on connection, like:

  1. If Computername()='YourServerName' then 
  2.     Connection to QMC Reload Database 
  3. else 
  4.     Connection to  QlikView Desktop Reload Database 
  5. End If
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Another variation on the same theme:

On your server, create an include file (let's call it ServerSettings.qvs) that says something like:

SET vReloadEngine = QMC;

In your document script, do two things.

  1. Add a default value for vReloadEngine by adding the following SET statement to your script front (for example at the end of the initial series of SET statements). Like
    SET vReloadEngine = Desktop;
  2. After that, add an optional include to load the server include file. If it doesn't exist, no worries. The reload engine won't complain and revert to the default value. Like
    $(Include=.\ServerSettings.qvs)

As long as you maintain that file on your server, the script will be able to make out where it's running. Whatever the name of the machine...

Best,

Peter

Anonymous
Not applicable
Author

Thank you nice idea, but there are lots of servers, i cant maintain a file, i am looking for function to find the engine and load

Peter_Cammaert
Partner - Champion III
Partner - Champion III

That may be what you want, but that will be difficult to get.

You see, the engine that is reponsible for reloads on your server is actually a QV Desktop without user interface called QVB.exe (QlikView Batch) that still thinks its name is QV.exe.

AFAIK if you want to figure out where the reload is taking place, you may have to rely on the environment telling you. Not the engine itself.

marcus_sommer

I use for similar tasks (triggering OnOpen excel-macros which must know who is executing them) external parameter either created by small store-statements or per vbs-writing in a text-file which will be evaluated from the depending routines. After finishing the excel-macro reset this parameter to its default-value.

I think you could adapt this approach to your task whereby purely inside of Qlik I would go with the suggestions from Peter or Tresesco maybe by extending the computername() logic to a mapping (if there are really multiple server) maybe something like this:

Map:

mapping load * inline [

ComputerName, Database

Server1, DB1

Server2, DB2

...

Desktop, DBx

];

DataBase: load applymap('Map', computername(), '#NV') as DataBase autogenerate 1;

let vDatabase = fieldvalue('Database', 1);

...

- Marcus

Anonymous
Not applicable
Author

Thank you, but i am looking for solution where unknown users and unknown servers are there, we cannot really keep track of everything, anywhere, anytime the script should identify the engine and load the respective db for desktop or server.

Anonymous
Not applicable
Author

Currently i am using the below script to identify the servers and desktop using registry string, but if QMC is running on desktop client, it will fail.. i need something which more robust.

LET vOS = GetRegistryString('HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion', 'ProductName');

Thanks

Hari.