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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to retain the first row obtained where we get duplicate values for a column?

Hi all,

I have a scenario like

ID Supervisor

1   Krishna

1   Vamsee

2   -

2   Priya

Now I want the data to be displayed as

ID  Supervisor

1    Krishna

2    -

how can we achieve this?

1 Solution

Accepted Solutions
its_anandrjs
Champion III
Champion III

Hi,

See the attached sample file it is your solution that you want You need to load data by FirstValue( ) function and use the fields in straight table or simple table box.

Let me know about this

HTH

Rgds

Anand

View solution in original post

4 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

You have not indicated how the data should be sorted to use the first row or each value. If you are planning to use the supervisor name, then you should be aware that the null will always sort after the non-null values.

Do you want to do this in the load script or in a chart/table object?

For a chart, create one with dimension ID, and expression If(Rank(Supervisor) = 1, Supervisor))

Depending on what you want to do, look at Firstsortedvalue and rank functions to select the first row.

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Hello Jonathan,

I want to use it in a straight table,The sort order is the load order

I have tried using ID as dimension and rank() function as you mentioned in expression

The output straight table looks like

ID Expression

1   -

2   -

What is the meaning of this?

Thanks

Priya

its_anandrjs
Champion III
Champion III

Hi,

You have to use FirstValue( ) function in your load script.

Rgds

Anand

its_anandrjs
Champion III
Champion III

Hi,

See the attached sample file it is your solution that you want You need to load data by FirstValue( ) function and use the fields in straight table or simple table box.

Let me know about this

HTH

Rgds

Anand