Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to identify the first column in a table ?

Hi All,

        I have the following table:

City1LatitudeLongitude
Chak Forty M29.73961871.633704
Chak Forty M32.20204971.755182
Chak Forty M32.01594371.581087
Chak Forty SB31.92638972.826389
Chak Forty30.69666773.446944
Chak Four26.43470368.565174
Chak Four28.013767.705a2
Chak Four28.41941670.181164

I want to show only the first column in the straight or pivot table without hardcoding the City.

I tried using FirstSortedValue function but was not able to get the result.

Can any one help me on this.

Thanks.

6 Replies
rajat2392
Partner - Creator III
Partner - Creator III

can you please explain a little bit better with some example if possible...

Not applicable
Author

try to use:

=only({<$FieldNo={1},$Table={'TableName'}>}$Field)

where TableName is name of your table.

regards

Darek

simondachstr
Luminary Alumni
Luminary Alumni

Create an Inline table containing all field names you want to use, and the implement the following expression:

$(=FirstSortedValue(FieldNames,Order))

This works for me..

maxgro
MVP
MVP

not sure to undestand but if this is your requirement

you can try adding a counter  (see script below) and then use it in expression firstsortedvalue (see lable in image)

1.png

load *, rowno() as row;

load * inline [

City1, Latitude, Longitude

Chak Forty M ,29.739618 ,71.633704

Chak Forty M ,32.202049 ,71.755182

Chak Forty M ,32.015943 ,71.581087

Chak Forty SB ,31.926389 ,72.826389

Chak Forty ,30.696667 ,73.446944

Chak Four ,26.434703 ,68.565174

Chak Four ,28.0137 ,67.70502

Chak Four ,28.419416 ,70.181164

];

or if you want just a column try with a dimension like

=[$(=minstring ({1<[$Table]={TableName},[$FieldNo]={1}>} $Field) )]

MarcoWedel

it works when using dollar sign expansion on the previously suggested expression by Darek (credits to him):

=$(=only({<$FieldNo={$(vFieldSelector)},$Table={'tabCities'}>}$Field))

QlikCommunity_Thread_115567_Pic1.JPG.jpg

QlikCommunity_Thread_115567_Pic2.JPG.jpg

QlikCommunity_Thread_115567_Pic3.JPG.jpg

QlikCommunity_Thread_115567_Pic4.JPG.jpg

regards

Marco

anbu1984
Master III
Master III