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

Filter in visualization

Kindly help me in the below logic in the measure:

I have the below formula:

SUM(Total_Transfer)

I want the sum of only those whose Transfer date is maximum means MAX(Transfer_date).

Something like that:

SUM({$<Transfer_date = {MAX(Transfer_date)}>}Total_Transfer)..

But it is not working.

Thanks and Regards

Deepanshu

1 Solution

Accepted Solutions
swuehl
MVP
MVP

What is

=Max(Uploaded_Date)

returning in a text box?

Maybe you need to use

$(=Date(Max({<Report_Type = {W}>} Uploaded_Date),'YYYY-MM-DD hh:mm:ss'))

View solution in original post

14 Replies
sunny_talwar

May be this:

Sum({$<Transfer_date = {"$(=Date(Max(Transfer_date), 'YourDateFieldFormatHere'))"}>}Total_Transfer)

UPDATE: Max(Transfer_date) will return a number and to convert it to Date you will have to use Date function and also make sure that the formatting is also the same one as Transfer_date.

swuehl
MVP
MVP

Max Transfer_date in the TOTAL context, right?

SUM({$<Transfer_date = {$(=Date(MAX(Transfer_date),'MM/DD/YYYY'))}>} Total_Transfer)


format the max date as Date using Date() function and using an appropriate format code ('MM/DD/YYYY' is just an example).

sunny_talwar

Attaching a sample where I used a particular kind of formatting to display Transfer_date (MMMM DD, YYYY)


Script:

Table:

LOAD Date(MakeDate(2015, 1, 1) + Ceil(Rand() * 365), 'MMMM DD, YYYY') as Transfer_date,

  Ceil(Rand() * 1000000) as Total_Transfer

AutoGenerate 10000;

And then the expression I used:

Sum({$<Transfer_date = {"$(=Date(Max(Transfer_date), 'MMMM DD, YYYY'))"}>} Total_Transfer)

HTH

Best,

Sunny

Anonymous
Not applicable
Author

Thanks a lot for your guidance!!

I am still getting error while using the formula. The date format is YYYY-MM-DD hh:mm:ss.

Attached is the snapshot of the formula I used.

Kindly help me!!

Regards

Deepanshu

swuehl
MVP
MVP

What error message do you get? Have you tried to just press ok and check the result in your chart?

sunny_talwar

Like Stefan said, I don't see where the error is? Are you seeing null or 0s?

Anonymous
Not applicable
Author

I am getting 0 value

Thanks

Deepanshu

Anonymous
Not applicable
Author

Yes!!.. I am working on Qlik sense.. On the below it shows OK.

But still I am getting 0 value...

Please guide

Thanks!!

Deepanshu

sunny_talwar

Would you be able to share a sample?