Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
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;

View solution in original post

Chanty4u
Champion III
Champion III

Not applicable
Author

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