Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to show value based on max reportdate in KPI chart

Hello,

I have values based on reportdates,

Under current selection, I want to show value in KPI chart  according to max date among repordate.

for example: I want to show 1100 since, it is the latest date value (19.04.2018). Note: Report_Date and PeggedQty are field name.

  

Report_DatePeggedQty
02.04.2018500
06.04.20182500
13.04.20181500
19.04.20181100

thanks in advance

6 Replies
Thiago_Justen_

May be this:

FirstSortedValue(PeggedQty,-Report_Date)

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
Anonymous
Not applicable
Author

thank you but it did not work. Maybe I explained my issue wrong.

I want to sum all latest date values.

I try that:

sum({$<Report_Date={"$(=max(Report_Date))"}>}PeggedQty)

but it is not working either.

krishna_2644
Specialist III
Specialist III

In script add a field

floor(num(Date#(Report_Date,'dd.mm.yyyy'))) as DateNum; // to retrieve string date field as num values to sort from min to max


put this expression in KPI:

=sum({$<DateNum = {'$(=max(DateNum))'}>}PeggedQty)


1.PNG


i am attaching a qlikview file over here.but the same applies for Qlik Sense too.

Thiago_Justen_

Just format your date field to load script then your expression will work.

Date (Date#(Report_Date,'dd.mm.yyyy'),'dd.mm.yyyy') as Report_Date

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
Anonymous
Not applicable
Author

Hello Krishna,

It summ up all dates value. It results 5600 instead of 1100

   

Report_Date
PeggedQty
02.04.2018500
06.04.20182500
13.04.20181500
19.04.20181100 
Total5600
krishna_2644
Specialist III
Specialist III

1100 is the max value and total is 5600.