Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

two linked fields

hello,

I've got a litle pb with two fields:

I had a circular reference so I copy out a dimension.

error loading image

My pb is that I want to compare my two fact tables when they have the same value for "Annee"..

how can i do : when I click on one of fields the other one is selecting if the value is the same ?

thanks

sorry for my english

17 Replies
IAMDV
Luminary Alumni
Luminary Alumni

Is it possible to share the QV document with some sample data? That will be easy to fix the issue...

Cheers!

Not applicable
Author

thanks to take time to answer..

In the document there is the page which is a Pb..

I want to link the filed annee1 with the annee2... because the grid charges is linked to annee1 and the field insertion is linked to annee2 AND I want to link the 2 fact tables..

IAMDV
Luminary Alumni
Luminary Alumni

LOAD

id_annee,

id_periode,

(id_annee2 & '-' & id_periode2) AS UniqueID,

valueur_annee;

SQL SELECT *
FROM etl4.annee;

LOAD

id_annee2,

id_periode2,

(id_annee2 & '-' & id_periode2) AS UniqueID,

valueur_annee2;

SQL SELECT *
FROM etl4.annee2;

Please use the above script and replace them with(Lines 15 - 18 in example file)

SQL SELECT *
FROM etl4.annee;
SQL SELECT *
FROM etl4.annee2;

I can't test it to see if this helps. Because it is fetching the data from MySQL DB directly. So please let me know if this helps...

Good luck!

IAMDV
Luminary Alumni
Luminary Alumni

LOAD

id_annee,

id_periode,

(id_annee & '-' & id_periode) AS UniqueID,

valueur_annee;

SQL SELECT *
FROM etl4.annee;

LOAD

id_annee2,

id_periode2,

(id_annee2 & '-' & id_periode2) AS UniqueID,

valueur_annee2;

SQL SELECT *
FROM etl4.annee2;

Sorry, please ignore the above script and use this one...

Not applicable
Author

when I do that QV tells me I''ve got a cricular reference and it disablesone of the fact tables...

IAMDV
Luminary Alumni
Luminary Alumni

Ooops!

You are right. I had checked again and there will be circular reference. I just wanted to understand the difference between Annee & Annee2 tables? Do they need to be seperate? or can we merge them as one single table?

Thanks.

Not applicable
Author

we can merge them but it makes a circular reference.... I duplicated the hierarchy to avoid the circular reference but they are axactly same..

montubhardwaj
Specialist
Specialist


I looked into qvw file which you have attached but was very confusing. I am just giving you suggestion based on my understanding:

Seems like you want to join "anee2" with "anee". For that, first join Fact tables "anee" and "semestre" like this:

load * from semestre
left join
load * from annee

output of this will be a single table and say it "anee1" and it will have the below fields:
id_annee,
id_parcours,
intitule_parc,
id_periode,
valeur_annee

Now rename id_annee2 from "annee2" to id_annee

once you are done with this, I think you will be all set.
Hope that was helpful.