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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
francofiorillo
Partner - Creator
Partner - Creator

Combine data from two identical database.

<body><p><qtlend></qtlend><br /></span>Hello everyone!<br /></span>I need advice to make it easier, in the construction and maintenance, a merge operation (queuing) of data from two or more identical basic data structures. <br /></span>I start from the fact that on every database I've built a Qlik document, which is also the same even when I want mantenre db merged. <br /></span>lastrada which could be shorter? </span>Use CONCATENATE and aliases of the field, being careful to preserve the existing relations between fields? </span>Use JOIN?<br /></span>Can you suggest the right way and quick?<br /></span>thanks. </span></span></p> <p><qtlbar id="qtlbar" dir="ltr" style="display: inline; text-align: left; line-height: 100%; padding: 0pt; background-color: #ececec; cursor: pointer; z-index: 999; left: 239px; top: 25px; opacity: 0.9;"><img class="qtl" title="Copy selction" src="http://www.qtl.co.il/img/copy.png" /><a title="Search With Google" target="_blank" href="http://www.google.com/search?q=Combine%20data%20from%20two%20identical%20database."><img src="http://www.google.com/favicon.ico" class="qtl" /></a><img src="http://www.qtl.co.il/img/trans.png" title="Translate With Google" class="qtl" /><iframe id="qtlframe" style="display: none; border: 1px solid #ececec; background-color: white;"></iframe></qtlbar></p></body>

5 Replies
Not applicable

Ciao Franco,

mi potresti spiegare meglio?

Grazie

francofiorillo
Partner - Creator
Partner - Creator
Author

Normal 0 14 false false false IT X-NONE X-NONE MicrosoftInternetExplorer4

Ciao.

Ti ringrazio per l'interessamento.

Visto che parli in italiano, ti spiego in madrelingua.

Il problema è questo.

Ho un applicativo che è installato in diverse aziende sanitarie (ASL). Parliamo di Psichiatria (!).

Ora a livello regione avrei da unire i vari Data base (tutti uguali) per poter fare un'analisi globale delle attività scientifiche, ricoveri, diagnosi, ecc.)

Ovviamente alcune chiavi del data base, che potrebbero essere uguali nei vari DB, devono rimanere distinte,. Su questo , nessun problema.

Il problema non è tanto nel concatenare tutte le tabelle, ma quello di dover rinominare ,( con AS) tutti i campi non qualificati per fare in modo che i campi delle due tabelle siano uguali.

Ti faccio un esempio:

supponiamo che nel DB dell'Asl di Salerno si abbia la seguente tabella:

unqualify IDPazienti;

PAZIENTI:

Load…….

IDPazienti,

NomePaziente,

IndirizzoPaziente,

eccc:

from SALERNO


Nel DB dell'Asl di Napoli ci troviamo la stessa tabella:

unqualify IDPazienti;

PAZIENTI1:

Load…….

IDPazienti,

NomePaziente,

IndirizzoPaziente,

eccc:

FROM NAPOLI

ora per fare in modo che i dati delle due tabelle vengano incorporate in un solla tabella si potrebbe fare:

unqualify IDPazienti

PAZIENTI1:

Concatenate (PAZIENTI) LOAD

'C' & IDPazienti as IDPazienti,

NomePaziente,

IndirizzoPaziente

….

From TabellaPazienti (del DB di Napoli)

Il risultato finale sarebbe :

IDPazienti - PAZIENTI.NomePaziente - PAZIENTI.IndirizzoPaziente - PAZIENTI1.NomePaziente - PAZIENTI1.IndirizzoPaziente

Mentre io voglio una tabella del tipo

IDPazienti - PAZIENTI.NomePaziente - PAZIENTI.IndirizzoPaziente

Per fare questo dovrei (penso…) fare degli alias sulla seconda LOAD e squalificarli. Per esempio

unqualify IDPazienti, PAZIENTI NomePaziente, PAZIENTI.IndirizzoPaziente

PAZIENTI1:

Concatenate (PAZIENTI) LOAD

'C' & IDPazienti as IDPazienti,

NomePaziente as PAZIENTI NomePaziente,

IndirizzoPaziente as PAZIENTI.IndirizzoPaziente

Con questa mia idea penso risolverei, ma la trovo lunga, tediosa e poco elegante.

Puoi darmi un suggerimento?

Grazie .

ciao

Not applicable

I do not understand why not concatenate (and I also do not speak italian), could you give more details?

francofiorillo
Partner - Creator
Partner - Creator
Author

Hello. I'm sorry for the Italian (I'm not good at English). I try to translate.

The problem is this.

I have an application that is installed in different health units (ASL). We speak of Psychiatry (!).

Now in the region, a body in which the various health units are managed together, I want to merge the different data base (all equal) to do a comprehensive analysis of scientific activities, admissions, diagnosis, etc.).

Obviously, some of the key data base, which could be the same in different DB, must remain separate. On this, no problem.

The problem is not in the chain all the tables, but that of having to rename, (with AS) all the fields are not qualified to make the fields of the two tables are equal.

Let me give you an example:

Suppose that in the DB ASL Salerno has the following table:



unqualify IDPazienti;

PATIENTS:

Load ... ....

IDPazienti,

NomePaziente,

IndirizzoPaziente,

ECCC:

from SALERNO


In DB ASL Naples we find the same table with the same fields:



unqualify IDPazienti;

PAZIENTI1:

Load ... ....

IDPazienti,

NomePaziente,

IndirizzoPaziente,

ECCC:

FROM NAPLES



hours to ensure that the data of the two tables are incorporated in a raised table could be done:

unqualify IDPazienti

PAZIENTI1:

Concatenate (PATIENTS) LOAD

'C' & IDPazienti as IDPazienti,

NomePaziente,

IndirizzoPaziente

....

From TabellaPazienti (DB of Naples)



The end result would be:

IDPazienti - PAZIENTI.NomePaziente - PAZIENTI.IndirizzoPaziente - PAZIENTI1.NomePaziente - PAZIENTI1.IndirizzoPaziente



While I want a table of type

IDPazienti - PAZIENTI.NomePaziente - PAZIENTI.IndirizzoPaziente



To do this I should (I think ...) to make an alias on the second LOAD and dismissed them. For example



unqualify IDPazienti, PATIENTS NomePaziente, PAZIENTI.IndirizzoPaziente

PAZIENTI1:

Concatenate (PATIENTS) LOAD

'C' & IDPazienti as IDPazienti,

NomePaziente as NomePaziente PATIENTS,

IndirizzoPaziente as PAZIENTI.IndirizzoPaziente







With this idea I think I would answer, but I find long, tedious and inelegant.

Can you give me a hint?

Thanks.

hello

Not applicable

While I found this a bit hard to follow, I concur that CONCATENATE'ing the datasets appears to be the correct approach.  To keep the records identifiable by source, include a field such as:

'dataset1' AS RecSrc

in the LOAD of dataset1

and

'dataset2' AS RecSrc

in the LOAD of dataset2

You can then use Set Analysis or possibly Alternate States to analyze the separate data instances.