Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Find Last Time Per Days

Hello

We have the same data as below In Qlikview

i want Find Last Time/Value In Days.

That means a record for each day.

TestData.png

---------------------------------------------------------------------

Result Look Like :

Date                                   Value

1/1/2013   10:56 PM              15
12/11/2013 11:00 PM              19
12/11/2014   6:00 AM               26

1 Solution

Accepted Solutions
Kushal_Chawda

try this

Data:

LOAD Date as DateTime,

     Date(floor(Date)) as Date,

     Value

FROM

[New Microsoft Excel Worksheet.xlsx]

(ooxml, embedded labels, table is Sheet1);

Left Join(Data)

LOAD Date,

     date(max(DateTime)) as DateTime,

     1 as Flag

Resident Data

Group by Date;

On front end create straight table

Dimension:

DateTime

Expression:

=sum({<Flag={1}>}Value)

View solution in original post

10 Replies
Anil_Babu_Samineni

Script / Front End ??

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Output is important

---------------------------

Script/ Visual does not matter

PrashantSangle

chk firstSortedValue() or min()

Before that you have to create one more field which gives you only date from datetime field

Try below

Test:

Load Date as DateTime, Date(floor(Date)) as Date,Value from tableName;

Final:

Load Date,min(Value) as min_value Resident Test group by Date;

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 🙂
Anonymous
Not applicable
Author

it's not correct

PrashantSangle

Why????

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 🙂
tresesco
MVP
MVP

May be this?

Capture.PNG

Anil_Babu_Samineni

You must explain the reason as well if not suit to you. And check tresco image where prashant recoomend.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
PrashantSangle

Hi,

You can also try with firstsortedValue()

try below script

Test:

LOAD Date(floor(Date)) as Date,

Date as DateTime,

     Value

FROM

test.xlsx

(ooxml, embedded labels, table is Sheet1);

Final:

Load Date,FirstSortedValue(Value,-DateTime) as min_value Resident Test group by Date order by Date;

Regards,

Prashant

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 🙂
Kushal_Chawda

try this

Data:

LOAD Date as DateTime,

     Date(floor(Date)) as Date,

     Value

FROM

[New Microsoft Excel Worksheet.xlsx]

(ooxml, embedded labels, table is Sheet1);

Left Join(Data)

LOAD Date,

     date(max(DateTime)) as DateTime,

     1 as Flag

Resident Data

Group by Date;

On front end create straight table

Dimension:

DateTime

Expression:

=sum({<Flag={1}>}Value)