Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey,
In qliksense, i am trying to create a variable by calculate Year of posting date
My Date format is : MM/DD/YYYY hh:mm:ss TT
I am trying like:
vCurYear = Year(Date(Today(1), 'MM/DD/YYYY'))
Let say date is 10/25/2017, above expression giving me 2.02K in qliksense.
I want to store value i.e. 2017 in variable i.e. vCurYear.
How to solve this?
Thanks,
Nikhil Garg
Hi Nikhil,
I have created Varaible As Date
am getting value in text box see.
Regards
Sathish
try this
vCurYear = max(Year(date))
Nope, it is working in the same manner
can you share sample data
try
vCurYear = Year(getdate())
Hi Nikil,
you have using the below EXP:
vCurYear = Year(Date(Today(1), 'MM/DD/YYYY'))
Please use like below
vCurYear = Year(Date(Today(), 'MM/DD/YYYY'))
Regards
Sathish
Try to change Number Formating:
Or you must change it to a String.
To Format it without the point.
Hey Satti,
I tried your way but again same result. Pls find attached snapshot.
Also, i want to save the result in the variable.
Hey Ralf,
I need to save the result in the variable. I tried same number format at variable level, but does not worked
Hey Mikel,
Nope, it does not worked.