Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Created Current Month, Last Month Buckets

I want to create a new field in my load script that takes a date (MM/DD/YYYY) and puts it in a current month, last month, etc .. bucket

Also wonder if I can do this with rolling weeks ... i.e make a new field that says, last 4 weeks, last 8 weeks, last X weeks ...

Thank you,

- dave

1 Solution

Accepted Solutions
sunny_talwar

You should be able to do like this

If(Date >= MonthStart(Today()), 'Current Month',

If(Date >= MonthStart(Today(), -1), 'Last Month')) as Flag

Similar idea should apply for weeks

View solution in original post

1 Reply
sunny_talwar

You should be able to do like this

If(Date >= MonthStart(Today()), 'Current Month',

If(Date >= MonthStart(Today(), -1), 'Last Month')) as Flag

Similar idea should apply for weeks