Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Present only the max value

Hi all, 

I have a table that present for each question the user answer and the number of attempt he made for this question, see example table:

Quiz Attempt NumberQuiz QuestionAnswerUser Code
1- Did the Seller acknowledge how they feel about the change? trueDE1561
2- Did the Seller acknowledge how they feel about the change? trueDE1561
1- Did the Seller acknowledge how they feel about the change? falseDE1654
2- Did the Seller acknowledge how they feel about the change? trueDE1654
1- Did the Seller acknowledge how they feel about the change? trueDE1679
2- Did the Seller acknowledge how they feel about the change? trueDE1679
1- Did the Seller acknowledge how they feel about the change? trueDE1781
2- Did the Seller acknowledge how they feel about the change? falseDE1781
1- Did the Seller acknowledge how they feel about the change? trueDE1833
2- Did the Seller acknowledge how they feel about the change? trueDE1833
1- Did the Seller acknowledge how they feel about the change? trueDE2013
2- Did the Seller acknowledge how they feel about the change? trueDE2013
1- Did the Seller acknowledge how they feel about the change? trueDE2734
2- Did the Seller acknowledge how they feel about the change? trueDE2734

 

I would like to present for each user and question only his last attempt, 

i know i need to use aggr and max functions so how, but i wasn't able to find the solution, can someone help? 

2 Replies
Highlighted
Specialist III
Specialist III

Re: Present only the max value

FirstSortedValue([User Code],-Aggr([Quiz Attempt Number],[Quiz Question],User Code)) >>>>> results in User Code

 

Edited - there was two commas after Quiz Question:

FirstSortedValue([Quiz Question],-Aggr([Quiz Attempt Number],[Quiz Question],User Code))>>>>> results in Quiz Question

Thiago Justen Teixeira Gonçalves
WhatsApp: 24 98152-1675
Skype: justen.thiago
Highlighted
Contributor III
Contributor III

Re: Present only the max value

I tried implementing the code you wrote in the two columns,
but i get "Invalid dimension" 😞