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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
smilingjohn
Specialist
Specialist

Complex Date

HI ALl

sum({ $<[Fiscal Year] ={$(=vFisCurrYear)},[Fiscal Month ]={$(=vFisPrevMonth)},Month_DG=>}Cost

This expression is for current year previous month ..

And my fiscal month starts from April as 1st month

When i select  June this expression will display May releated data ( Previous MOnth)

and when i select April this has to display the data for March( which is of previous Year) ..

how can i include this condition in this Expression ...

Below is the content within the field

vFisPrevMonth=Max([Fiscal Month])-1

[Fiscal Year] = 2016,2017,2018

[Fiscal Month]= 1,2,3,4,....so on

vFisCurrYear= =MAX([Fiscal Year])


Can please someone suggest me on this ?

Thanks in advance

15 Replies
sunny_talwar

Can you try this

Sum({$<[Fiscal Year], [Fiscal Month], Month_DG, [Month Start Date_MIS] = {"$(=Date(AddMonths(Max([Month Start Date_MIS]), -1)))"}>} Cost)

smilingjohn
Specialist
Specialist
Author

Hi Sunny

THis is working if i select the month when i select pertivular year this is not working

Is there anything needs to be included in this ?

sunny_talwar

Really? I would have thought it would work... can you share  a sample where this isn't working?

smilingjohn
Specialist
Specialist
Author

Hi sunny

This is what iam using in expression

=Sum({$<[Fiscal Year_MIS], [Fiscal Month No_MIS], Month_MIS, [Month Start Date_MIS] = {"$(=Date(AddMonths(Max([Month Start Date_MIS]), -1)))"}>} Amount_SBU)

When i select the Fiscal month FIlter Which is = Month_MIS  this is will work

and when i select the fiscal year  from the filter  =[Fiscal Year Name_MIS] = ( which has year like this ...2016-2017 2017-2018)

when i make this selection the data show zero value..

Do we need to include this in the expression ?

sunny_talwar

Ignore that in your expression

=Sum({$<[Fiscal Year_MIS], [Fiscal Month No_MIS], [Fiscal Year Name_MIS], Month_MIS, [Month Start Date_MIS] = {"$(=Date(AddMonths(Max([Month Start Date_MIS]), -1)))"}>} Amount_SBU)

smilingjohn
Specialist
Specialist
Author

Thanks Sunny

You always Rock

Thanks a lot bro.....