Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Live chat with experts, bring your API Integration questions. June 15th, 10 AM ET. REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Rolling 4 and 12 month data in Qlikview

Hi,

I am a new learner in qlikview. I am looking for inputs on rolling 4 month and 12 month data.

For eg. If my month is March then rolling 4 months will be Feb, Jan, Dec and Nov

I have used the below expressions but it is not showing any data:

= Sum({<date= {">=$(=Date(AddMonths(max(date),-3),'DD-MMM-YYYY')) <=$(=Date(max(date),'DD-MMM-YYYY'))"}>}Units)

= Sum({<date= {">=$(=Date(AddMonths(max(date),-11),'DD-MMM-YYYY')) <=$(=Date(max(date),'DD-MMM-YYYY'))"}>}Packs)

Could you please provide your inputs.

Thanks in advance!!!!

Rohit

1 Solution

Accepted Solutions
muthukumar77
Partner
Partner

Hi,

Recheck your date format.

I think format is problem.

Try like,

=Sum({$<Date={">=$(=Date(AddMonths(max(Date),-3),'MM/DD/YYYY'))<=$(=Date(max(Date),'MM/DD/YYYY'))"}>}Unit)

=Sum({$<Date={">=$(=Date(AddMonths(max(Date),-11),'MM/DD/YYYY'))<=$(=Date(max(Date),'MM/DD/YYYY'))"}>}Packs)

Muthukumar Pandiyan

View solution in original post

9 Replies
muthukumar77
Partner
Partner

Hi,

What is Date format?

Muthukumar Pandiyan
PrashantSangle

Hi,

If your month max(date) month is march and you want to exclude it then

try below

= Sum({<date= {">=$(=Date(Monthstart(AddMonths(max(date),-4)),'DD-MMM-YYYY')) <=$(=Date(MonthEnd(AddMonths(max(date),-1)),'DD-MMM-YYYY'))"}>}Units)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Not applicable
Author

Hi MUthukumar,

It's DD-MMM-YYYY i.e. 14-Mar-2017

Thanks,

Anil_Babu_Samineni

Seems, your expression is okay to me. So, I assume your selection will happen for date and you are expecting from Month'

May be this? Or please provide sample

= Sum({<date= {">=$(=AddMonths(max(Month),-3)) <=$(=max(Month))"}>}Units)

= Sum({<date= {">=$(=AddMonths(max(Month),-11)) <=$(=max(Month))"}>}Packs)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
muthukumar77
Partner
Partner

Hi,

Recheck your date format.

I think format is problem.

Try like,

=Sum({$<Date={">=$(=Date(AddMonths(max(Date),-3),'MM/DD/YYYY'))<=$(=Date(max(Date),'MM/DD/YYYY'))"}>}Unit)

=Sum({$<Date={">=$(=Date(AddMonths(max(Date),-11),'MM/DD/YYYY'))<=$(=Date(max(Date),'MM/DD/YYYY'))"}>}Packs)

Muthukumar Pandiyan

View solution in original post

Not applicable
Author

I will try it and let you know with updates.

Thanks,

Rohit

muthukumar77
Partner
Partner

Did this work?

Muthukumar Pandiyan
Not applicable
Author

I am still getting the same issue, please advice.

Thanks,

Anil_Babu_Samineni

Can you provide sample to work on it

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)