Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
florianrathgebe
Contributor II
Contributor II

Singe Value in a text field

Dear All,

 

I have got a problem. Hope you can help me. I would like to have TextBox showing the value of the most counted KEYUSER_NAME. In this case "Keyuser A". If I only set "=KEYUSER_NAME" the field is null, because there is one "Keyuser B" within.

CostCenter  USERID  Benutzername KEYUSER_NAME
ABC1  ID000100 User A  Keyuser A
ABC1  ID000101 User B  Keyuser A
ABC1  ID000102 User C  Keyuser A
ABC1  ID000103 User D  Keyuser A
ABC1  ID000104 User E  Keyuser A
ABC1  ID000105 User F  Keyuser A
ABC1  ID000106 User G  Keyuser A
ABC1  ID000107 User H  Keyuser B
ABC1  ID000108 User I  Keyuser A

 

Does anyone has a solution for this?

If there are any questions, don't hesitate to contact me.

Best regards,

 

Florian

Labels (2)
1 Solution

Accepted Solutions
florianrathgebe
Contributor II
Contributor II
Author

Dear All,

I have figured it out.
I had to modify the answer from Agigliotti a bit. Thank you for the hint in the right direction.

The Solution is:
=FirstSortedValue( KEYUSER_NAME, -Aggr( Count(KEY_KEYUSER), KEY_KEYUSER ) )

Best regards,

Florian

View solution in original post

7 Replies
anushree1
Specialist II
Specialist II

Please check if the attachment helps

Code Used:

Total Count: =count(Keyuser)

Count of KeyUser A: ==count({<Keyuser={'Keyuser A'}>}Keyuser)

tresesco
MVP
MVP

Try like:

= 'Most counted key user is : ' &
=Only({<KEYUSER_NAME={"=Rank(Count(KEYUSER_NAME))=1"}>}KEYUSER_NAME)
agigliotti
Partner - Champion
Partner - Champion

maybe this:
=FirstSortedValue( KEYUSER_NAME, -Aggr( Count(KEYUSER_NAME), KEYUSER_NAME ) )
I hope it helps.
florianrathgebe
Contributor II
Contributor II
Author

Dear all,

thank you for the help, but unfortunately it does not work. I have created a Qlikview-file. With fictive data, but with the correct structure of the relevant fields of the tables.

Best regards,

Florian

anushree1
Specialist II
Specialist II

Could you tell us what is the desired output here?

florianrathgebe
Contributor II
Contributor II
Author

Dear Anushree,

for sure. I would like to have the KEYUSER_NAME which has the most counts for the selected data.
As example: the COSTCENTER "ABC193" has got 9 Users. For 8 of them "Name07" is the KEYUSER, for 1 it is "Name03". The texbox should show me in this example"Name07".

Best regards,

Florian

florianrathgebe
Contributor II
Contributor II
Author

Dear All,

I have figured it out.
I had to modify the answer from Agigliotti a bit. Thank you for the hint in the right direction.

The Solution is:
=FirstSortedValue( KEYUSER_NAME, -Aggr( Count(KEY_KEYUSER), KEY_KEYUSER ) )

Best regards,

Florian