Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Rajkumar
Creator
Creator

MonthYear and Month Selection Problem

Hi all,

I have two fields YearMonth and Month .If I select Month previous year value is showing correctly and when I select YearMonth  the value is not showing for prev year value.

My expression :  =Sum({<Year = {'$(=Max(Year)-1)'}>} Sales)

I wanted both  fields to  work correctly for expression 

.Months.PNG

 

Thank you

5 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Try this.

 

Sum({<Year = {'$(=Max(Year)-1)'},YearMonth=>} Sales)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Rajkumar
Creator
Creator
Author

Thanks  for @kaushiknsolanki  quick reply.

 

If I use this expression, the YearMonth Selection is not working.

Sum({<Year = {'$(=Max(Year)-1)'},YearMonth=>} Sales)

 

Kushal_Chawda

try to exclude selection of YearMonth & Month

=sum({<YearMonth,Month,Year = {'$(=Max(Year)-1)'}>} Sales)

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Try this.

Sum({<Year = {'$(=Max(Year)-1)'},YearMonth=,Month=('$(=Maxstring(Month))')>} Sales)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Rajkumar
Creator
Creator
Author

Thank you  Solanki  for response.

It is applicable for only one selection. There are chances that users select more than one.