Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Last entry from excel

Please can someone tell me how to use the last entry from excel for a chart.

columnA               columnB

09/01/20162,642
16/01/20162,079
23/01/2016

2,060

I want to pick up value 2060 as the last entry, however next week there will be a new entry and I want to pick up that.

ALWAYS the last entry in columnB

Thanks!!!!!!!!!!!!

1 Solution

Accepted Solutions
jonas_rezende
Specialist
Specialist

Hi.

The date is in format integer, but with  Date() function it is converted  for MM/DD/YYYY. Try MaxString(Date(columnA)). Do the same for Exists(Date(columnA)).

View solution in original post

8 Replies
PrashantSangle

Hi,

Try Peek() or FirstSortedValue()

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
gsbeaton
Luminary Alumni
Luminary Alumni

Hi Emma,

You can order your loaded data in descending order and then just load the first record.  Something like this:

testData:

LOAD * INLINE [

columnA, columnB

09/01/2016, 2642

16/01/2016, 2079

23/01/2016, 2060

];

LoadedData:

FIRST 1 LOAD

*

RESIDENT testData

ORDER BY columnA DESC;

drop table testData;

If you are getting your data from a database, you can use SQL to load only the last row, which would be a better approach if you have a lot of data.  But this method should get you started.

Cheers

George

sunny_talwar

or if the chart is sorted in ascending order of columnA, then you can also use LastValue() function

gsbeaton
Luminary Alumni
Luminary Alumni

I may have got the wrong end of the stick here,

If you want to grab the last entry using an expression, do this:


  FirstSortedValue(ColumnB, ColumnA, -1)


Cheers

George

jonas_rezende
Specialist
Specialist

Hi, harrisone.

You can use MaxString() and Exists() functions. Example:

TableAux:

Load

MaxString(columnA)          AS columnA

From

Excel.xls

(biff, embedded labels, table is [Sheet1$]);

TableA:

Load

columnB

From

Excel.xls

(biff, embedded labels, table is [Sheet1$])

where

Exists(columnA);

Drop table TableAux;

Hope this helps!

Not applicable
Author

Hi Jonas

Thanks for the reply.

The first part:

MaxString(columnA)          AS columnA


Returns a number.......... 42392 ? Not a date.

jonas_rezende
Specialist
Specialist

Hi.

The date is in format integer, but with  Date() function it is converted  for MM/DD/YYYY. Try MaxString(Date(columnA)). Do the same for Exists(Date(columnA)).

Not applicable
Author

Re: Last entry from excel

Jonas MeloExpert