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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calendar Field

Hi All

I have a "Date" field and would like to use to create a BudgetMonth Field based on two dates.

The condition is that the budget months starts on the 26th of every months and ends on the 25th. I would like to create a Field that can give me a result like this: from 26 December to 25 January "Dec - Jan", from 26 January to 25 February "Jan - Feb"

How can I write this expression?

1 Solution

Accepted Solutions
sunny_talwar

This?

Capture.PNG

Script:

Table:

LOAD *,

  If(Day(Date) < 26, Month(Date) & ' - ' & Month(AddMonths(Date, -1)), Month(AddMonths(Date, 1)) & ' - ' & Month(Date)) as BudgetMonth;

LOAD Date(MakeDate(2014, 12, 31) + RecNo()) as Date

AutoGenerate 730;

View solution in original post

3 Replies
sunny_talwar

This?

Capture.PNG

Script:

Table:

LOAD *,

  If(Day(Date) < 26, Month(Date) & ' - ' & Month(AddMonths(Date, -1)), Month(AddMonths(Date, 1)) & ' - ' & Month(Date)) as BudgetMonth;

LOAD Date(MakeDate(2014, 12, 31) + RecNo()) as Date

AutoGenerate 730;

Not applicable
Author

Thanks ...my expression was slightly different hence wit was not working