Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
mariamovasheli
Contributor III
Contributor III

max Year Month

hello,

I want to show max month on the line chart.

I am Using this formula and its not Working and can you please advise me something.

sum({$<Year = {$(=max(Year))}, Month = {$(=max(Month))}>} FactSoldAmount)

8 Replies
sunny_talwar

Try this

Sum({$<Year = {$(=Max(Year))}, Month = {'$(=Max(Month))'}>} FactSoldAmount)

dwforest
Specialist II
Specialist II

Please delete this duplicate thread....

mariamovasheli
Contributor III
Contributor III
Author

hi, It doesn't work without selection. If I select 2018 or another year it is correct but Without it it Doesn't Show anything

keerthika
Creator II
Creator II

Hi,

As sunny said the above expression will work fine . Can you share your app to check

sasiparupudi1
Master III
Master III

I think you need to use date field to filter you data rather than using year and month fields

Please share your calendar so that we can help you better

mariamovasheli
Contributor III
Contributor III
Author

Hi, This is my calendar.

Calendar:

Load

Distinct

%lnk_date,

Date(%lnk_date) as Date,

Day(date) as day,

year(%lnk_date) as Year,

month(%lnk_date) as Month,

'Q' & ceil(month(%lnk_date)/3) as Quarter,

'Q' & ceil(month(%lnk_date)/3)  & '`' &  right(year(%lnk_date),2)  as [Year Quarter],

  ceil(month(%lnk_date)/3) as %QuarterNum,

month(%lnk_date)  & '`' &  right(year(%lnk_date),2)  as [Year Month] ,

year(%lnk_date)*100 + month(%lnk_date) as %ym

Resident  GasOperatingSales;

sunny_talwar

Would you be able to share a sample or some sample data to look at this?

sasiparupudi1
Master III
Master III

May Be try

Sum({$<Year =, Month = , [Year Month]={"$(=Max( [Year Month]))"}>} FactSoldAmount)