Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

deepanshu_chamo1
New Contributor

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

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: Filter in visualization

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'))

14 Replies
MVP
MVP

Re: Filter in visualization

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.

MVP
MVP

Re: Filter in visualization

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).

MVP
MVP

Re: Filter in visualization

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

deepanshu_chamo1
New Contributor

Re: Filter in visualization

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

MVP
MVP

Re: Filter in visualization

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

MVP
MVP

Re: Filter in visualization

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

deepanshu_chamo1
New Contributor

Re: Filter in visualization

I am getting 0 value

Thanks

Deepanshu

deepanshu_chamo1
New Contributor

Re: Filter in visualization

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

But still I am getting 0 value...

Please guide

Thanks!!

Deepanshu

MVP
MVP

Re: Filter in visualization

Would you be able to share a sample?