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: 
abhaysingh
Specialist II
Specialist II

As Date Range, Cumulative sum in report

Hi Every one,

I am attaching one sample file in which the output required in below format

the output i want like

Default view For current month =Data shud show for last month,

i.e.Say Current month is July16, Data shud come for From Apr16 to Jun16.

Default View For Previous Month = Data Should come Cuurent Month - 2

i.e Say you are in Jun16, Data shud come for the period of Apr16 to May16

i need to give the feasibility to the user that he can select the dates to check the data accordingly,

e.g. Let Say User has selected 30.03.2016, means March16 which is the 12th period as per fiscal Year which is 2015.

output shud come like

For Current Month = Apr15 to Mar16

For Prev Month = Apr15 to Feb16.

and if the selected date is 30.06.2016, the output shud come like

For Current Month = Apr16 to jun16

For Prev Month = Apr16 to may16.

Note = i am working on stock data and stock data will be applicable at monthend only.

I am following Fiscal Year

Hope i am clear.

Hey Hope this is fine now stalwar1‌,, thanks for you suggesiton.

thanks

1 Solution

Accepted Solutions
swuehl
MVP
MVP

I guess prev year should be something like

=Sum({<Dates = {">=$(=Date(Yearstart(Max(Dates),-1,4)))<$(=Date(Yearstart(Max(Dates),0,4)))"}>} value)

View solution in original post

16 Replies
sunny_talwar

Thanks abhay

abhaysingh
Specialist II
Specialist II
Author

any suggestion on the output required?

Frank_Hartmann
Master II
Master II

I would recommend you to create a MasterCalendar.

then it should be easy to create link between a date and an according daterange!

swuehl
MVP
MVP

Maybe like attached?

With two expressions for current and previous

=Sum({<Dates = {">=$(=Date(Yearstart(Max(Dates),0,4)))<=$(=Date(Max(Dates)))"}>} value)

=Sum({<Dates = {">=$(=Date(Yearstart(Max(Dates),0,4)))<$(=Date(Max(Dates)))"}>} value)

abhaysingh
Specialist II
Specialist II
Author

Hi Sweul,

when user is selecting 30.04.2016, Previous month should be 31.03.2016, right now is is giving 0 only. please suggest on this.

thanks

swuehl
MVP
MVP

Previous month should be 31.03.2016 only, or  30.4.2015 to  31.03.2016, i.e. full previous FY.

And Current year would then show only 30.04.2016?


edit:

Maybe then like this for prev month:


=Sum({<Dates = {">=$(=Date(Yearstart(Monthstart(Max(Dates),-1),0,4)))<=$(=Date(Monthstart(Max(Dates))))"}>} value)

abhaysingh
Specialist II
Specialist II
Author

Hi Swuehl,

could you pls help me condition for  Prev Year  as well..

thanks for support




swuehl
MVP
MVP

Maybe, what are your requirements for prev year / current year (compared to prev month / current month)?

abhaysingh
Specialist II
Specialist II
Author

Hi Swuehl,

Requirement is Current Year, Prev Month and Prev Year Data Shud be shown in one Report.

Prev Year Data should shown like below Rest you already suggested me

as per user selection date of 30.04.2015,

the period should be 30.04.2015 to 31.03.2016