Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Creating a New Variable

Hi All,

I need to create a variable say as Month which needs to have the values as Jan-09,Feb-09,...etc dynamically.Can some one help me out on this.?

Thanks,

Arun

5 Replies
sparur
Specialist II
Specialist II

Hello, Arun.

If you have a field MonthYear, you can create a variable vMonth = MonthYear.

then when you will select one value from MonthYear field - your variable will be evaluate.

Not applicable
Author

hi

you can use:

LET vMMMYY = Date(today(),'MMM-YY');

Not applicable
Author

Hi Arun,

Could you elaborate a bit further on the need of the variable and what do you mean by "dynamically"?

Not applicable
Author

Hi Jain,

Thanks for your reply.My problem is that i have a variable month in the format 'Jan-09','Feb-09',,,,etc.Now if i want to use this month filed which takes the values dynamically (i.e) if i specify a condition as current month it has to take the latest month(June) from the Month variable and previous month as last month(May).

Not applicable
Author

Sorry for th delayed response

In case you just want to use the current and the previous month you could use the following formula to get the month # of the current and the precious month

Current month = Month( max(Date))

Previous month = Month( max(Date)) - 1