Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
raffaeleg
Contributor II
Contributor II

Same app, same data model, different source how to

Hello everybody,

I have 2 applications on the same stream, let's say A and B. A and B are exactly the same, the only difference is the name of the app.The data displayed in the apps is different because it comes from different sources.

I have a qvd layer with 2 apps, let's say QA and QB, connectors pointing to different sources, that store the qvds in a repository. QVD from QA will be replaced by QVD from QB when I load QB.

When I need to refresh A, first I generate the qvd from QA, then I load A.

I would like to keep the qvd separate, one folder for QA and a folder for QB, but I want to keep A and B exactly the same, not to duplicate the changes on them, I would need to parametrized the data folder 

Is there a way I can parametrized in app A and B the connection to folder QA or QB?

Thanks for your help.

Labels (3)
1 Solution

Accepted Solutions
Levi_Turner
Employee
Employee

Sure, you can pass variables down to the load script.

Ultimately it sounds like you're looking for something like this:

LET vReduceValue = Trim(SubField(DocumentTitle(), ' - ', 2));
Trace $(vReduceValue);

What this will do is take the App Name and store the variable after the -. So in the example on my end:

  • App Name: Analytics - AB
  • vReduceValue: AB

You can then pass the vReduceValue down to the load from QVD. My colleague Fady worked on this approach for a scenario where there was more automation required here: https://github.com/fadyheiba/QSLoopAndReduce But the principle remains the same for your use case. The nice benefit of this style of approach is that you can keep the exact same base app for improvements then publish & replace the two copies so that your development work-flow is dynamic based on the app's name.

View solution in original post

2 Replies
Levi_Turner
Employee
Employee

Sure, you can pass variables down to the load script.

Ultimately it sounds like you're looking for something like this:

LET vReduceValue = Trim(SubField(DocumentTitle(), ' - ', 2));
Trace $(vReduceValue);

What this will do is take the App Name and store the variable after the -. So in the example on my end:

  • App Name: Analytics - AB
  • vReduceValue: AB

You can then pass the vReduceValue down to the load from QVD. My colleague Fady worked on this approach for a scenario where there was more automation required here: https://github.com/fadyheiba/QSLoopAndReduce But the principle remains the same for your use case. The nice benefit of this style of approach is that you can keep the exact same base app for improvements then publish & replace the two copies so that your development work-flow is dynamic based on the app's name.

raffaeleg
Contributor II
Contributor II
Author

Thanks @Levi_Turner that is exactly what I was looking for.

I gave it a try and I can retrieve the name of the app in the load script.

I will parametrize the qvd repository upon the app name.