Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Stuck with SQL problems

Hello! I have a trouble, and would be really happy if you could help me

First, this i my SQL selections from a ODBC.

sqlselect.JPG.jpg

This works perfect. I make plots of this to see different answ_call_cnt and aband_call_cnt with the different queues. And i make selections with Year, month and day. Nemas problemas!

But my Table viewer is quite hard to understand.

tableviewer.JPG.jpg

Because now i would like to import some agent_name from the Agent_logg. See picture below.

ccdatabase.JPG.jpg

But i don't get it to work 😕

Any input would be greats. I can't post a sample file because im on a private license and connected to ODBC.

12 Replies
Not applicable
Author

You don't appear to have anything to link the agent_logg_id back to any of your data tables.

I would assume the Queue_Logg table would contain and advisor id or ref, so you would need to update the queue_logg sql to pull through that, and also the agent_logg table to join.

The Queue is not enough in your model to pull agent info.

flipside
Partner - Specialist II
Partner - Specialist II

I would say the issue is the field date_from which appears in each table - it is causing sythentic keys in the load script. Is this a common link field between each table? Remember, Qlikview automatically creates joins between tables based on field names.

flipside

its_anandrjs

Hi,

In your data model a synthetic keys generated due to same field names like date_from or queue if you want to increase a performance remove any field from any table if not required or simple rename it in that table. And for agent_name you have to find the Agent_logg_id field among the different table that available or not then you link it or join with that table.

Hope this helps

Thanks & Regards

Not applicable
Author

agent_logg_id.JPG.jpg

I have the Agent_logg_id in the Service_goals table. Where i get my goal_desc and goal_id from.

Not applicable
Author

queuelogg.JPG.jpg

Here is the Queue_logg table, i have tried different solutions, but can't get it right.

Thanks for you effort and answers!

Not applicable
Author

Yes, but i think i need to have these 2 days_from, because when i make selections in "Year" "Month" "Day" i want the right connections!

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Perhaps you should be joining Queue_logg to Goal_results - like this:

     SQL .... FROM Goal_Results;

     Join

     SQL .... FROM queue_logg

This will correctly link the data between the two tables if the relationship between these two tables is properly described by queue and date_from. If that is not the case, then you will need to bring in enough data to associate the tables correctly.

Joining like this will eliminate one table and the syn key from your model.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
flipside
Partner - Specialist II
Partner - Specialist II

I don't think we have enough info on what the data is. The table Goal_Results looks like it is pre-aggregated data (judging by the _cnt fields = count?), that is one row for each combination of queue and date_from, whereas queue_logg could be multiple rows per queue and date_from (unless it is also aggregated at that level). Could end up with incorrect aggregation in the front end.

Erik, are my assumptions correct?


flipside

Not applicable
Author

There's not (IMO) enough data being loaded from the source - and the data that appears above has no direct link back to the agent_logg table,

As part of the load script, the agent_logg needs to be pulled in then joined with the agent_logg_id to the respective table, otherwise it's not possible.