Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

alexis
Contributor III

String concatenation in variable declaration

Hi

I'm trying to create a variable that looks at the current year and month to decide on the content based on the simple rule:

So far I have

SET ThisYear = Year(Today());

SET ThisMonth = num(Month(Today()));

SET ThisFY = '=if($(ThisMonth)>6, $(ThisYear)+1, $(ThisYear))';

This works great - it returns 2018 for Jan-June 2018,  2019 for July-Aug 2018

I want to create a variable that will contain the value FY18 or FY19 in the above scenario.

I have tried variants of:

SET ThisFY_Full = 'FY' & right('$(ThisFY)',2);

and nothing seems to work - can someone help out.

I'm sure this is very simple - it's just that I am not achieving it.

Thanks in advance

Alexis

1 Solution

Accepted Solutions

Re: String concatenation in variable declaration

Try this

SET ThisYear = Year(Today());

SET ThisMonth = num(Month(Today()));

LET ThisFY = if($(ThisMonth)>6, $(ThisYear)+1, $(ThisYear));


LET ThisFY_Full = 'FY' & right('$(ThisFY)',2);

2 Replies

Re: String concatenation in variable declaration

Try this

SET ThisYear = Year(Today());

SET ThisMonth = num(Month(Today()));

LET ThisFY = if($(ThisMonth)>6, $(ThisYear)+1, $(ThisYear));


LET ThisFY_Full = 'FY' & right('$(ThisFY)',2);

alexis
Contributor III

Re: String concatenation in variable declaration

Thanks Sunny

I was close but not close enough!!

Community Browser