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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Gopi_E
Creator II
Creator II

how to get association between three tables

Hi Qlikers,

@sunny_talwar could you please look in to this

i have a requirement like,  i have a three tables from this table i need to calculate 3 metrics, 

Route_NameRoute_TollsRoute_Distance
CPT-DBN51650
JHB-DBN41400
CPT-JHB5570
POL-JHB4320

 

GantryGantry_NameRouteLatitudeLongitude
TG001BARBETN1-228739289980
TG002MOSSIEN1-238983289389
TG003INDIALIAN1-234646280548
TG004PIKOKON1-230908280566

 

RegToll_IdToll_NameToll_TypeTransDateTrans_TimeTerminalAmount
BP64FBTG0505 IVUSIEtoll_Gantry07-10-201913:1910051500
BP64FBTG066 IVUSIEtoll_Gantry08-10-201914:1910061501
BP64FBTG077 IVUSIEtoll_Gantry09-10-201915:1910071502
BP64FBTG058 IVUSIEtoll_Gantry10-10-201916:1910081503

 

from above table i need to calculate 

1. Number of times a trip/Route has been driven

2.Total cost of the trips

3. Using the provided route distance calculate CPK for each trip/route

Labels (1)
1 Solution

Accepted Solutions
Kushal_Chawda

as per the data, it should be count(distinct Route_Name) but as I said ask this question to your business and clarify

View solution in original post

9 Replies
ramasaisaksoft

Hi

use AutoNumber() for each table so that it will create a new filed with same name

now create this auto number for 3 tables and give the same name.so that association will create between tables automatically.

Now u can do your calculations/Expressions.

Gopi_E
Creator II
Creator II
Author

Hi ramasai,

thanks for the reply,

for Autonumber() which fields i have to use for generating new field.

sunny_talwar

What would be the required output based on the sample data provided?

Brett_Bleess
Former Employee
Former Employee

Gopi, just making sure you saw Sunny's post...  He requested additional info on what your output needs to look like in comparison to the inputs, please be sure to circle back and provide an update with that info if you still need help.  If you resolved things, consider posting what you did, and then use the Accept as Solution button on that post afterward to mark it as the solution.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
Gopi_E
Creator II
Creator II
Author

Sorry for the late reply sunny, I was on leave

Here requirement is How can i associate above three tables, which field i need to use for getting association.

Please give any suggestions.

 

 

Kushal_Chawda

Looking at your data I don't see any column on which you can associate the 3 tables. But the same question you can ask to your business or database owner. Or you can ask a logic to calculate KPIs

Gopi_E
Creator II
Creator II
Author

Hi kush,

thanks for the reply,

do you have any idea how i can calculate Number of times  trips driven 

Kushal_Chawda

as per the data, it should be count(distinct Route_Name) but as I said ask this question to your business and clarify

Gopi_E
Creator II
Creator II
Author

Thank you,