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: 
ift_isabelle
Partner - Creator III
Partner - Creator III

AppName?

Hi,

I want to include my appname in the script as a variable.

Like this: My app name is Client 1 or Client 2.

And I want to check in the script which app its is.

If it is Client 1 the script should load other parts of the same database then if it is Client 2.

I know about Section Access, but this doesn't resolve my problem, because my app is too big. So it gets slow. I just want the possibility to publish the same app a few times with different names and apply rules with that names.

Thanks in advance.

Kind regards,

Isabelle

1 Solution

Accepted Solutions
tracysmart
Creator II
Creator II

Hi Isabelle

there is system function called DocumentName() that you can query in your script, this will contain the name of the app.

Tracy

View solution in original post

18 Replies
rittermd
Master
Master

Can you be more specific as to what you are trying to do?

Would Section Access accomplish what you needed if it wasn't slow?  Or are you trying to accomplish something else with the loading of your data?

Do you know what is making the app slow when using Section Access?

I use Section Access in many of my apps to limit what facilities each user can view.  I am only dealing with about 4M rows of data though.  It is not slow at all.

ift_isabelle
Partner - Creator III
Partner - Creator III
Author

Section access does exactly what I need. But in three months my app, with all the clients, grew to almost 1 GB. I have over 300 million rows. So in 1 year it will be at least 4 GB.

It is already a bit slow and I don't have the illusion the speed will go up, while adding more data.

Any ideas?

Not applicable

Hi Isabelle,

What I got by your concern, You have two values or I can say two flags ,Client1 and Client2 and you have two scripts one is for Client1 and Client2 or same script for both values. Now if Client1 value comes in picture at load time then Client1 script will load else Client2.

This can achieve by where and else : lets take an example:

Load

Client,

Product

from database

where  Client= 'Client1'

else

Load

Client,

Product

from database

where  Client= 'Client2'

and store the both load statement on one single QVD.

Now if you are try to make a button or input box where you enter Client1 and Client1 will load I donot think this is possible.

Please let me know if this is not your concern.

Please mark the appropriate replies as CORRECT / HELPFUL so our team and other members know that your question(s) has been answered to your satisfaction.

ift_isabelle
Partner - Creator III
Partner - Creator III
Author

I don't want to load both in in one QVD, because it is too big.

I want the QVD to throw away the data it doesn't use, but both apps should contain the same visualisations.

So i want to make one app where I develope my new visalisation or dataloads and then publish it over multiple apps. I want to make a rule where it throws away the data from other clients, so my apps become smaller.

Example:

Development app ==> contains all the data = 1 GB, 300 milion + rows

Client 1 ==> same as Development app but only with the data of client 1 = 100 MB, 20 million rows

Client 2 ==> same as Development app but only with the data of client 2 = 75 MB, 15 million rows

Etcetera


So i need an identifier for the app, so i can just publish my Dev app over my client apps.

In the first section I want to write a piece of code where it says only load data of client X and throw away the rest.

I can do that with an "If .. then ..."-statement.


Or is there any other way to make this possible, without rewriting the loadscript when i want to publish?


tracysmart
Creator II
Creator II

Hi Isabelle

there is system function called DocumentName() that you can query in your script, this will contain the name of the app.

Tracy

Not applicable

Hi Isabelle,


I think I got your concern, I read it twice and what I understood now, You have one application lets say APP1(6 sheets) and you have two show it to Client1  as Cilent1APP and Client2 as Client2App with diffrent rules like Client1 can see 3 sheets and Client2 will see other 3 sheets. So this is possible as:


Make two duplicate of APP1 which are Cilent1APP and Cilent2APP and then create two App Object Access Rule for Cilent1APP and Client2 as Client1 can see first 3 sheets of APP1 with name Cilent1APP and Client2 will see Cilent2APP with other 3 sheets.

Please mark the appropriate replies as CORRECT / HELPFUL so our team and other members know that your question(s) has been answered to your satisfaction.

Not applicable

Hi Isabella,

Hope you are doing good!

I have a best solution for you. See sometimes when you stuck at something so you think its a big issue s solution will also be complex but here its very easy.

Lets say you have one app APPBASIC which have two Clients data Client1 and Client2 .Now You want that when user who want to see Client1 data will see only Client1 and same for Client2 but I agree you donot want to do section access , So this is possible as:

Go to HUB =>  MY Work and  APPBASIC and duplicate it two times and name them as APP1 and APP1. as try to make the names similar as your can . Now open your APP1 => go to its script editor => add a condition at fact table that where Client = Cleint1 and do the same thing as Client= Client 2. Now APP1 have Client1 data and APP1. have Client2 data and then go to QMC and publish both application APP1 and APP1. in same stream and use security rules and say user who want to see Client1 data will access APP1 and who want to see Client2 data will access APP1.

what it is ,Only you know , User will always see one application in the stream and each application has only that client data which you want.

Please mark the appropriate replies as CORRECT / HELPFUL so our team and other members know that your question(s) has been answered to your satisfaction.

Rohit Kumar

ift_isabelle
Partner - Creator III
Partner - Creator III
Author

Hi Rohit,

Thanks for your reply, it thought of this solution before, but it's not going to work:

In your scenerio: I make changes to my basic app every two weeks. So I need to duplicate it two times, and adjust my script (two times) and publish it two times every two weeks.

At the moment, that's workable, because I don't have many clients using it (more than 2, but i can manage to do this). But our goal is to have at least 200 clients in 2 years. Then I have to do the duplicate everything 200 times, Adjust the script 200 times and publish 200 times. That is not workable.

So I need a stable, workable solution.

Kind Regards Isabelle

(with an E at the end)

ift_isabelle
Partner - Creator III
Partner - Creator III
Author

Thanks!

Found it!