Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
AH
Creator III
Creator III

Issue on Showing other months value on selection in Current Month(2014) and Current Month(2015) calculation

Hi,

My expression for the calculation of  Current month(2015), Current Quarter(2015) and Current month(2014), Current Quarter(2014) is giving me the exact numbers i am looking for. So, Now is the month of April and i am getting current month value for both 2014 and 2015. Also, when i select Jan, Feb and March i am also getting values for both 2014 and 2015. But when i am selecting May or June all the values are showing in 2015 Text box and 2014 text box is showing zero. But for mont May and June 2015 doesnt have any values because those months hasnt started yet.

The expressions i used for the Current month Text box for Item A is mentioned below. And some snapshots are also attached.

Current Month(2014):
=num((Sum({<SalesItemID={'A'},[Invoice Year] = {'$(=Max([Invoice Year]-1))'},[Invoice Month] = {'$(=Max({<[Invoice Year] = {"$(=Max([Invoice Year]))"}>}[Invoice Month]))'}>}[Invoice Units])),'##,##0')

Current Month(2015):
=num((Sum({<SalesItemID={'A'},[Invoice Year] = {'$(=Max([Invoice Year]))'},[Invoice Month] = {'$(=Max({<[Invoice Year] = {"$(=Max([Invoice Year]))"}>} [Invoice Month]))'}>}[Invoice Units])),'##,##0')

Could you please guide me whats going wrong here?

Thanks,

Ahmed

2 Replies
ramoncova06
Partner - Specialist III
Partner - Specialist III

for 2014 expression you are not using the Max([Invoice Year]-1), is there a reason why you cannot use month instead for your max expression ?

AH
Creator III
Creator III
Author

Hi,

Current Month(2014):
=num((Sum({<SalesItemID={'A'},[Invoice Year] = {'$(=Max([Invoice Year]-1))'},[Invoice Month] = {'$(=Max({<[Invoice Year] = {"$(=Max([Invoice Year]))"}>}[Invoice Month]))'}>}[Invoice Units])),'##,##0')

In the above expression for 2014 i already have [Invoice Year] = {'$(=Max([Invoice Year]-1))'}.

Thanks,

Ahmed