Qlik Community

Ask a Question

App Development

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

Announcements
April 22, 2PM EST: Learn about GeoOperations in Qlik Sense SaaS READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jdean1012
Contributor III
Contributor III

Date Variable Evaluating as a Math Problem

I have two variables in my load script.

Let vCurrentMonthStart = '11/01/2020';

Let vCurrentFiscalYear = Right(YearName($(vCurrentMonthStart), 0, 4), 4);

vCurrentMonthStart works correctly and returns the date 11/01/2020.

vCurrentFiscalYear evaluates vCurrentMonthStart as a math problem and returns 1900 instead of the desired 2021 for our Fiscal Year.  (11/1)/2020 = 0.0054455445544554

What am I doing wrong?  THANKS IN ADVANCE!!!

Labels (3)
1 Solution

Accepted Solutions
jdean1012
Contributor III
Contributor III
Author

I figured it out. Surrounding the vCurrentMonthStart in quotes forced it to evaluate as a date and works now.

Let vCurrentFiscalYear = Right(YearName('$(vCurrentMonthStart)', 0, 4), 4);

View solution in original post

1 Reply
jdean1012
Contributor III
Contributor III
Author

I figured it out. Surrounding the vCurrentMonthStart in quotes forced it to evaluate as a date and works now.

Let vCurrentFiscalYear = Right(YearName('$(vCurrentMonthStart)', 0, 4), 4);

View solution in original post