Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I have an issue as i want to create a variable with month & year in a format as 'YYYYMM'.
The Month is taken from the getfieldselection and Year as well.
So whatever Month and Year is selected from the Calendar, it should from a variable.
(Both Month and Year are Seperate Listbox).
Please help if you have any idea.
Thanks in advance.
Shashank
Create Variable
vYearMonth = Max(Year)&Max(MonthNum)
Regards,
Kiran
But it will be give me current month as i guess.
But i want to make a variable from the selections made on Month & Year filters.
If you select Month and Year, It will change as per your selections.
Regads,
Kiran
Ok...i got that..What if i want to concatenate both the filed as YYYYMM.
then you have to use Concatenated field
=Max(YearMonthNum)
Declare a variable whose expression will evaluate at run time
SET vMyVariable = '=GetFieldSelections(year) & GetFieldSelections(month)';
then you can refer to this in the document by $(vMyVariable) and it will calculate the expression accordingly,
for instance in a textbox =$(vMyVariable) will display the YearMonth selected, moreover you can add a selections count in order to display 0 or whatever you want. notice how important is the = equal sign after the first '.
see attached doc.
sorry...i didnt get it. Can you please explain?
Let me give you my scenario once again.
I have a Month & a Year filter. I want to make a variable with the selections made in the filters.
This variable should be in Date Format as YYYYMM as i have to compare it another fields in the Chart expressions.
can you provide an example of the comparison you have to implement as there might be other possibilities than creating a variable to do so?
Here is an example of showing monthnames and get the month (associated) num and make the date according to selection: so, define the variable as 'MakeDate(only(year),only(month))' either thru document or script load as follows: You can also format later on using Date($(vMyVariable),'heregoesyourformat') in case needed.
LOAD * INLINE [
month, monthName
1, Jan
2, Feb
3, Mar
4, Apr
];
LOAD * Inline [
year
2010
2011
2012
2013
2014];
SET vMyVariable = 'MakeDate(only(year),only(month))';