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: 
Not applicable

Loop question

Hi All,

I have the following loop in my data model. Any thoughts on how I can avoid the loop as am getting incorrect results? Thanks in advance!Untitled.png

7 Replies
Not applicable
Author

To solve this problem you need create two tables AGENT one for Reservation and other to agent_stats

You need to eliminate the table "Agent".

Not applicable
Author

Thanks for your reply. Which one should I use in my reports? Can you please provide more details? Thanks again for your help.

Not applicable
Author

Do you can post your file script?

Basically you need to do this:

Date:

LOAD

     time_key,

     reservation_date_skey,

     date_skey

FROM YOUR_TABLE_DATE;

Reservations:

LOAD

     reservation_date_skey,

     rev_agent_

FROM YOUR_TABLE_RESERVATION;

AgentReservation:

LOAD

     rev_agent_

FROM Agent

EmailStats:

LOAD

     time_key

FROM YOUR_TABLE_EmailStats;

AgentStats:

LOAD

     date_skey,

     agent_skey

FROM YOUR_TABLE_AGENTSTATS;

JOIN(AgentStats)

LOAD

     agent_skey

FROM Agent;

Not applicable
Author

Thansk again, but what am asking is, i'll end up with two agents in the model. When reporting, do I need to be careful on which one I should use? The agent table has 8 more columns that I dind't include in the picture as am not allowed. Please advise.

Not applicable
Author

so that there is this circular reference is necessary to create two tables of agents.

To prevent problems with ocorrea the fields in this table, you can enter an alias for fields eg:

AgentStats:

AgentStas_date_skey

AgentStas_agent_skey

AgentReservation:

AgentReservation_rev_agent_

Not applicable
Author

I think he is trying to use the same table to display table information and AgentStats AgentReservation, so just created this circular reference.

qliksus
Specialist II
Specialist II

Hi,

I think you should create a master table which is just concatenation of all unique key combinationj from all required table. From there you need to give link the all your table.