Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
Crichter141
New Contributor II

Variable Review Help

We created a variable but when we preview it in the application we're getting a missing ')' error.   When I take out the CHR(39) in Qlik the coding is fine, but that has worked in other variables.  Can anyone spot what I'm doing wrong?


Thanks in advance!

 

LET vPYMinCurrentDateSelection = '=
if(GetFieldSelections([DATE FILTER GROUPS]) = '&CHR(39)&'TODAY'&CHR(39)&', $'&'(var_12MonthsAgo),
if(GetFieldSelections([DATE FILTER GROUPS]) = '&CHR(39)&'CURRENT SEASON'&CHR(39)&', $'&'(var_2_Season_Ago_Start_Date),
if(GetFieldSelections([DATE FILTER GROUPS]) = '&CHR(39)&'WEEK TO DATE'&CHR(39)&', $'&'(var_CurrentWeekStart_Minus1Year),
if(GetFieldSelections([DATE FILTER GROUPS]) = '&CHR(39)&'LAST SEASON'&CHR(39)&', $'&'(var_3_Season_Ago_Start_Date),
if(GetFieldSelections([DATE FILTER GROUPS]) = '&CHR(39)&'MONTH TO DATE'&CHR(39)&', $'&'(var_CurrentMonthStart_Minus12Months),
if(GetFieldSelections([DATE FILTER GROUPS]) = '&CHR(39)&'LAST 6 WEEKS'&CHR(39)&', $'&'(var_6wks_and_12mth_ago),
if(GetFieldSelections([DATE FILTER GROUPS]) = '&CHR(39)&'LAST 1 MONTH'&CHR(39)&', $'&'(var_13MonthsAgo),
if(GetFieldSelections([DATE FILTER GROUPS]) = '&CHR(39)&'LAST 2 MONTHS'&CHR(39)&', $'&'(var_14MonthsAgo),
if(GetFieldSelections([DATE FILTER GROUPS]) = '&CHR(39)&'LAST 3 MONTHS'&CHR(39)&', $'&'(var_15MonthsAgo),
if(GetFieldSelections([DATE FILTER GROUPS]) = '&CHR(39)&'LAST 6 MONTHS'&CHR(39)&', $'&'(var_18MonthsAgo),
if(GetFieldSelections([DATE FILTER GROUPS]) = '&CHR(39)&'LAST 12 MONTHS'&CHR(39)&', $'&'(var_24MonthsAgo),
if(GetFieldSelections([DATE FILTER GROUPS]) = '&CHR(39)&'LAST FULL MONTH'&CHR(39)&', $'&'(var_CurrentMonthStart_Minus13Months),
if(GetFieldSelections([DATE FILTER GROUPS]) = '&CHR(39)&'YEAR TO DATE'&CHR(39)&', $'&'(var_CurrentYearStart_Minus1Year),
if(GetFieldSelections([DATE FILTER GROUPS]) = '&CHR(39)&'FINANCIAL YEAR TO DATE'&CHR(39)&', $'&'(var_FY_YearStart_Minus1Year),Min(Distinct PY_DATE_NUM)
))))))))))))))';

Labels (3)