Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
srik00001
New Contributor III

How to use same data model with multiple apps

I have created a data model and want to use it for multiple apps with each app just using a specific data set.

For ex: I have a data model that is binary load into apps A, B C

A should data filtered down to customer ID= 1

B should data filtered down to customer ID= 2

C should data filtered down to customer ID= 3

Any ideas on how i go about doing this?

Thanks,

Sri

Tags (1)
4 Replies
MVP
MVP

Re: How to use same data model with multiple apps

This is kind of a loop & reduce approach.

I would suggest writing a small macro that loops through your customer IDs.

Within each loop, open the base QVW, select the customer ID, reduce data to possible values, save to a new QVW with customer ID added to filename.

[I assume you don't have a QV publisher at hand.]

markodonovan
Valued Contributor

Re: How to use same data model with multiple apps

Hi there,

You could add a right join to filter the customer, for example:

if this data was your data model (probably more complex

data:

LOAD * inline [

customer

1,

2,

3

];

After you do the binary statement and all the set statements add something like this:

reduce:

right join(data)

LOAD

  1 as customer

AutoGenerate(1);

In this example the list will only show customer 1.

Thanks

Mark

Partner
Partner

Re: How to use same data model with multiple apps

Hi,

Depends what you are trying to do?

Is the separate final dashboards all the same, but just for an individual customers?

I this is the case take a look at section access and or loop and reduce.

Else if they are going different dashboard.

Create a dashboard the extracts the data from source and format as needed.

Then on you front end dashboards the script will pretty much be the same though out, just the adding a where statement at the end of the tables

Where CustomerID = '1'

for example.

Mark

Partner
Partner

Re: How to use same data model with multiple apps

Hi Sri,

You have to create  a separate application based on the customerId with same data modelling i.e each application's contains only those customerid information only.

2 -options:

1) Use your publisher, to distribute your application based on the customerid or

2) while creating the qvd's, use for loop to created the custimerid wise qvds. example if you have customer.qvd and it contains CustomerId has 1,2,3,4,5 values. Instead of creating the 1 qvd, Create 5 qvds like CustomerId_1.qvd,Customer_2.qvd

3) Export your main script into qvs and use the include statement to read the qvs file

4) In your script itself put if condition to check the which qvd you want to read.

5) create one variable and assign the value of customer id. It should be dynamic so I will prefer take the qvw name and each qvw name also assign the customer id value

Hope this will helpful for you.

I have done the same way for document chaining its successfully works.

-Sathish