Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Highlighted
florianrathgebe
New 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
New Contributor II

Re: Singe Value in a text field

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

7 Replies
anushree1
Valued Contributor

Re: Singe Value in a text field

Please check if the attachment helps

Code Used:

Total Count: =count(Keyuser)

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

MVP
MVP

Re: Singe Value in a text field

Try like:

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

Re: Singe Value in a text field

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

Re: Singe Value in a text field

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
Valued Contributor

Re: Singe Value in a text field

Could you tell us what is the desired output here?

florianrathgebe
New Contributor II

Re: Singe Value in a text field

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
New Contributor II

Re: Singe Value in a text field

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