Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
amaaiia
Contributor III
Contributor III

How can I solve this circular reference?

Hi!

I want to represent a train transport system with stations and train lines. The tables are as follows:

STATIONS_1:

STATION_1 TRAIN_LINE NUM_USERS
A 1 5
B 1 7
C 1 4
D 2 5
E 2 6

 

STATIONS_2:

STATION_2 TRAIN_LINE
A 1
B 1
C 1
D 2
E 2

 

CLOSE_STATIONS:

STATION_1 STATION_2
A B
A C

 Asw e cane see, there is a circular reference that is causing problems.

Qlik user is going to select a STATION_1 in the filter pane and a table will show the values of STATION_2 field that belong to the same TRAIN_LINE and that are also close to STATION_1 (the relationship STATION_1-STATION_2 appears in CLOSE_STATIONS).

For example, if STATION_1=A is selected, STATION_2 shown values will be B and C. But, if STATION_1=B, there won't be values for STATION_2, because although A and C are from the same TRAIN_LINE (1), they don't appear in CLOSE_STATIONS as a relationship.

I can't join STATION_1 and STATION_2 duplicating the rows because NUM_USERS column would be also duplicated.

Any ideas about how to solve this circular reference?

Labels (1)
2 Replies
Or
MVP
MVP

Have a look at this:

https://community.qlik.com/t5/Design/Circular-References/ba-p/1469332

or:

https://help.qlik.com/en-US/sense/November2023/Subsystems/Hub/Content/Sense_Hub/LoadData/understand-...

The specifics of how to break up the circular reference depends on what exactly you're trying to do with the data, but the methods for doing so are covered in the above links.

vincent_ardiet_
Specialist
Specialist

You can try to join CLOSE_STATIONS to STATION2_2, you will still have a composite key, this is not ideal but still much better.