Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ViniciusOrtis03
Contributor III
Contributor III

Incorrect Expression

ViniciusOrtis03_0-1663869678192.png

Hello, I need help with a calculation that I can't finish, well in this calculation I have a dimension and a variable.

The dimension, max(COMPETENCE) goes up to the date of 01/09/2022 , but I need this calculation to only be applied to dates less than or equal to 01/07/2022.

As a variable, v_ultima_comp_fechada has this value: =makedate(2022, 7)

In this way it is apparently correct because the month in which the calculations are being carried out is Max(COMPETENCE) which is 09/01/2022 which is my criterion of 01/01/2022 the value comes ZERO as DESIRED!

 

But when added in another column with a data less than or equal, for example: ViniciusOrtis03_1-1663871168090.png

COMPETENCE = {"$(=Date(MonthStart(max({<COMPETENCE={'<=$(v_ultima_comp_closed)'}>}COMPETENCY),-2)))"


Where COMPETENCE = 01/07/2022

v_ultima_comp_closed = 01/07/2022


Calculus keeps coming to zero again

ViniciusOrtis03_1-1663871168090.png

ViniciusOrtis03_2-1663871400902.png

 

Labels (4)
1 Solution

Accepted Solutions
RafaelBarrios
Partner - Specialist
Partner - Specialist

Hi @ViniciusOrtis03 

your problem should be here

{'<=$(v_ultima_comp_closed)'}
Because when you want to evaluate >, >=,< or <= you should be using double quotes.

and don’t know what’s the -2 does

 

so, you can try this

COMPETENCE = {'$(=Date(MonthStart(max({<COMPETENCE={"<=$(v_ultima_comp_closed)"}>}COMPETENCY))))'}

best,

View solution in original post

4 Replies
RafaelBarrios
Partner - Specialist
Partner - Specialist

Hi @ViniciusOrtis03 

your problem should be here

{'<=$(v_ultima_comp_closed)'}
Because when you want to evaluate >, >=,< or <= you should be using double quotes.

and don’t know what’s the -2 does

 

so, you can try this

COMPETENCE = {'$(=Date(MonthStart(max({<COMPETENCE={"<=$(v_ultima_comp_closed)"}>}COMPETENCY))))'}

best,

ViniciusOrtis03
Contributor III
Contributor III
Author

Hello @RafaelBarrios , Thanks for the answer, really worked.

 

RafaelBarrios
Partner - Specialist
Partner - Specialist

GREAT !!!!!

you were really really  close

ViniciusOrtis03
Contributor III
Contributor III
Author

hahahaa yes, i didn't see, the difference " and ' in expression