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: 
Not applicable

How to get first occurrence of value

Hi all,

I have a table with Customer that contain the identical Account numbers (Customer branch/store), but have 2 different Customer Names.

For example : Customer            AccNum    

                     CASH                  1

                     CASH                  2

                     CASH                  3

                     CASH SALE        1

                     CASH SALE        2

                     CASH SALE        3

This only occurs with some of the records, but I'd like to return the first or either one of the CUSTOMER Names and the Account Number, instead of 2 unique one.

Is there a way to achieve this?

Many thanks

1 Reply
calvindk
Creator III
Creator III

Try FirstSortedValue()

or even better, just use MaxString() or MinString()

ie, if your dimension is Account, just use MaxString(CustomerName)