Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Not applicable

Concatenate month and year variable

Hi, I have a column 'Month' which contains the month names and another variable 'year' which contains years 'YYYY'. How do I concatenate these 2 variables? Thanks.

4 Replies
Not applicable

Re: Concatenate month and year variable

HI

you can concatenate two fields

Month &'/'& Year as MonthYear

Thanks

Padma

Not applicable

Re: Concatenate month and year variable

Hi Rachel,

     If you have two variables do this:   

          LET NewVariable = $(MonthVariable) & $(YearVariable);

   

     But if you want to concatenate values stored in one table column (Month) whith one variable you must do it into the script using this      into the LOAD:

         FieldName & VariableName as NewFieldName

         Month & vYear as MonthYear

   

     Let me know if you need more details.

Regards.

jebamalai
Valued Contributor

Re: Concatenate month and year variable

I hope you have created a master calendar and you can add the below code

This will create a field called MonthYear automatically

Date(Monthstart(TempDate),'MMM-YYYY') as MonthYear,

Re: Concatenate month and year variable

1. if they are two fields then use it like

Load

Month&'-'&Year  as NewField

From Location;

2. And if they are variables then use it like

Let vNewVariable =  $(vMonthVar)&'-'&$(vYearVar)

3. if Year is variable and month is field then

Load

Month&'-'&'$(vMonthVar)' as NewField

From Location;