Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
pgalvezt
Specialist
Specialist

Last Value Date Dolar

Hi,

I have a table with values obtains in web.

Can you help me to obtain the last value in the Fields Mes and Día.

Here is the link if you have questions:

DOLAR OBSERVADO 2015

I need the value on 20th aug

Tomorrow on 21th aug and so on.

Thanks!! !

1 Solution

Accepted Solutions
swuehl
MVP
MVP

You need to create a date from Mes and Dia, so you can use the Date field in FirstSortedValue.

See attached.

View solution in original post

5 Replies
swuehl
MVP
MVP

You need to create a date from Mes and Dia, so you can use the Date field in FirstSortedValue.

See attached.

pgalvezt
Specialist
Specialist
Author

Thanks!

In 2016 Do I have to create the same code (2016) and concatenate?

RESULT:

LOAD *, Date#('2016-'&Mes&'-'&Día,'YYYY-MMM-D') as Date

Resident INPUT;

DROP TABLE INPUT;

swuehl
MVP
MVP

You probably just want the value for today, right?

So you can use

RESULT:

LOAD *, Date#(Year(today())-'&Mes&'-'&Día,'YYYY-MMM-D') as Date

Resident INPUT;

DROP TABLE INPUT;

If you need to keep historic data, a concatenation would only make sense for the latest date value on each new day, right?

pgalvezt
Specialist
Specialist
Author

Right,

by the way:

RESULT:

LOAD *, Date#(Year(today())-'&Mes&'-'&Día,'YYYY-MMM-D') as Date

Resident INPUT;

DROP TABLE INPUT;

I pasted this code but doesn´t work.

swuehl
MVP
MVP

Yes, there is a typo in the calculated field:

RESULT:

LOAD *, Date#(year(today())&'-'&Mes&'-'&Día,'YYYY-MMM-D') as Date

Resident INPUT;