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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to identify a record where there is more than one record linked to this record

Hello guys

Herewith my problem/question:

I am working with tripinfo. Every single trip is captured on a tripsheet.

Each trip is allocated to either one driver or two drivers.

In my load script I want to allocate a double crew tag to a tripsheet if there is more than one driver linked to that trip.

I am able to do this on the front end, but how do I achieve this in the back end (script).

Herewith my extract from the front end:

TripsheetNumbercount(DISTINCT DriverID)Tag
543658-201506092
Double Crew
543659-201506092
Double Crew
540077-201505281Single Crew

The 'Tag' column is the result I am looking for.

2 Replies
MayilVahanan

Hi

Try like this

Load TripsheetNumber, If(Count(Distinct DriverID) = 1, 'Single Crew', 'Double Crew') as Tag

From datasource

Group by TripsheetNumber;

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
giakoum
Partner - Master II
Partner - Master II

Count drivers per trip (group by trip) in the drivers table and then use the result to applymap it on the trips table.