Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
ZimaBlue
Creator
Creator

Creating a variable from another variable

Hello!

I have a variable that is a date. I want to create another variable, which will be the month from the date in this variable. I try

=Month($(vDateFrom))

, and different variations of it (including even explicit conversion to date via Date#), but it absolutely doesn't work.

How to perform this simple action?

ZimaBlue_0-1644851360363.png

 

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

The $(...) construction is a macro expansion, which means that if you write
=Month($(vDateFrom))
the parser will see
=Month(1.12.2021)
which is an incorrect syntax.

Try
=Month('$(vDateFrom)')
or
=Month(vDateFrom)

View solution in original post

2 Replies
hic
Former Employee
Former Employee

The $(...) construction is a macro expansion, which means that if you write
=Month($(vDateFrom))
the parser will see
=Month(1.12.2021)
which is an incorrect syntax.

Try
=Month('$(vDateFrom)')
or
=Month(vDateFrom)

ZimaBlue
Creator
Creator
Author

It works perfectly! Thanks a lot, I really didn't think to try this option. Thanks!