Qlik Community

Qlik Sense App Development

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

mehmet_okcu
New Contributor

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
Valued Contributor III

Re: How to show value based on max reportdate in KPI chart

May be this:

FirstSortedValue(PeggedQty,-Report_Date)

Thiago Justen Teixeira Gonçalves
WhatsApp: 24 98152-1675
Skype: justen.thiago
mehmet_okcu
New Contributor

Re: How to show value based on max reportdate in KPI chart

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
Valued Contributor III

Re: How to show value based on max reportdate in KPI chart

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
Valued Contributor III

Re: How to show value based on max reportdate in KPI chart

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
WhatsApp: 24 98152-1675
Skype: justen.thiago
mehmet_okcu
New Contributor

Re: How to show value based on max reportdate in KPI chart

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
Valued Contributor III

Re: How to show value based on max reportdate in KPI chart

1100 is the max value and total is 5600.

Community Browser