Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
alexvalqlik
Contributor III
Contributor III

Validate date with variable does not work

Regards,

I have a variable with the date of Today:

v_AñoAnt

= Max (Year) -1

v_FecFinAcumAnt

AddYears (today (), -1)

the expression validating the variable does not work:

Sum ({<Año = {$ (v_AñoAnt)}, Fecha = {'<= $ (v_FecFinAcumAnt)'}, Mes =, EQUIPO =, Sector_Material =>} Sale_Neta) / 1000

the expression validating the date directly if it works:

Sum ({<Año = {$ (v_AñoAnt)}, Fecha = {'<= 10/16/2017'}, Mes =, EQUIPO =, Sector_Material =>} Sale_Neta) / 1000

Can you tell me how to proceed

Thank you.

3 Replies
Zhandos_Shotan
Partner - Creator II
Partner - Creator II

Hi,

1. Use doubleqoutes for value search query in set analysis "<= $ (v_FecFinAcumAnt)". Single quotes usually applied for exact text values.

2. Try v_FecFinAcumAnt = '=AddYears (today (), -1)' - Test it as precalculated variable value.

https://help.qlik.com/en-US/sense/September2018/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/SetA...

Double quotes should be used for searches, i.e. strings that contain wild cards or start with a relational operator or an equals sign. For example, <Ingredient = {"*Garlic*"}> will select all ingredients that contain the string ’Garlic’. Double quotes can be substituted with brackets, for example, <Ingredient = {[*Garlic*]}>. Double quotes can also be substituted with grave accents, for example <Ingredient = {`*Garlic*`}>. Searches are case-insensitive.

In previous versions of Qlik Sense, there was no distinction between single quotes and double quotes and all quoted strings were treated as searches. To maintain backward compatibility, apps created with older versions of Qlik Sense will continue to work as they did in previous versions. Apps created with Qlik SenseNovember 2017 or later will respect the difference between the two types of quotes.

Regards

alexvalqlik
Contributor III
Contributor III
Author

Dear Zhandos,

I made the suggested changes, but it still gives me back value 0.

Zhandos_Shotan
Partner - Creator II
Partner - Creator II

Hi

Do you solved your problem?

You can put a sample app here.