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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
pranaview
Creator III
Creator III

Loading a String field while using Group by clause

Hi All,

Requirement: I need to identify the team which has taken the most time to perform its task for a request. Now I have multiple teams working on a request and i am calculating the Lead time for each and my table looks like something this 

pranaview_0-1589122051757.png

where A,B,C and D columns represent team names and the values in them time. I am using CrossTable() function to get the teams as a value in a field and their subsequent times in another as below

pranaview_1-1589122163852.png

Now what I am finally looking for is to get one record per request from the above table which gives me the team with the max time, something like this

pranaview_2-1589122250033.png

I know i have to use the Group by clause here with Max(Time) but i can't get the Team field in the Resident load with group by clause.

Is there any workaround for this or any other solution that i can implement to get the Team the with the max time for each request.

I hope i have made the problem fairly clear so any help or suggestions will be very much appreciated.

Thanks,

Pranav

 

Labels (1)
1 Solution

Accepted Solutions
pranaview
Creator III
Creator III
Author

I got it done by taking a resident load on the cross table by ordering the Time field in desc order and then taking another resident load using group by clause and firstValue() on Teams. I don't need the Time value in the final table, just the team name which has the max time which i get as the first value on my final load since i have ordered my prior resident load with Time field ordered desc.

View solution in original post

1 Reply
pranaview
Creator III
Creator III
Author

I got it done by taking a resident load on the cross table by ordering the Time field in desc order and then taking another resident load using group by clause and firstValue() on Teams. I don't need the Time value in the final table, just the team name which has the max time which i get as the first value on my final load since i have ordered my prior resident load with Time field ordered desc.