Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
brunov86
Contributor II
Contributor II

Variable interpreted as a division operation instead of a string label

Hi everyone,

I'm facing an issue with a variable in my chart. It's being interpreted as an operation instead of a string label.

brunov86_1-1708966688846.png

Here's what I'm trying to achieve:

I want to display the year range like "2019/2020", "2020/2021", and so on.

In the variable editor, here's my formula:

=if(Month(Today())>=4, (Year(Today()))&' / '&(Year(Today())+1), (Year(Today())-1)&' / '&(Year(Today())))

I've tried adding the Text function, but it's still not working as expected and keep getting interpreted as a division operation.

Any suggestions on how to fix this?

Thanks in advance for your help!

Qlik Sense Business 

Labels (1)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

IF are you using a Variable for the Dimension! then remove the leading = sign from the variable definition that will fix it

 

Or you can just use YearName() function as below

=YearName(today(),0,4)

Or

=Replace(YearName(today(),0,4),'-','/')

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

2 Replies
vinieme12
Champion III
Champion III

IF are you using a Variable for the Dimension! then remove the leading = sign from the variable definition that will fix it

 

Or you can just use YearName() function as below

=YearName(today(),0,4)

Or

=Replace(YearName(today(),0,4),'-','/')

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
brunov86
Contributor II
Contributor II
Author

Thanks Vineeth.

Works like a charm !

I used Replace(YearName(today(),0,4),'-','/') as suggested.