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: 
patricesalem
Creator II
Creator II

greater in expression combined with qsVariable

Hello

I'm setting up a Qlik report, using Qlik Desktop and the the qsVariable extension.

It works great except for an expression where I'm trying to use a > or < comparison

The following works :

sum({<Week={$(VCurrentWeek)}>} qte_commandee)

As soon as I try to replace the = by <=  (lower than), no data appear in my analysis :

sum({<Week=<{$(VCurrentWeek)}>}qte_commandee)

I have also tried

sum({<Week={'<="$(VCurrentWeek)}>}qte_commandee)

and many other trials...with no luck


At the same time, I have tried to transform the Week field and the VCurrentWeek into a numeric value (num#) since all my weeks are formated on two digits

the week field is populated in this way : num(week(order_date),'00')

The $VCurrentWeek is : num(week(now()),'00')


So, I gess the first error comes from the proper use of <= in the expression.

I also guess that I will need to transform the week number filed and variable into a numerica value


How can I do ?


Thanks

pat

1 Solution

Accepted Solutions
andrey_krylov
Specialist
Specialist

Hi, Patrice. You're right and if you convert Week field into numeric it should work.Try this then

sum({< Week = {"$(='<=' & num(week(now()),'00'))"} >} qte_commandee)

View solution in original post

3 Replies
patricesalem
Creator II
Creator II
Author

hello again

using this thread :Set Analysis for Less than Equal

I have updated my expression with no luck :

Sum({<date_saisie.autoCalendar.Week ={"<=$(=VCurrentWeekNum)"}>}qte_commandee)

As you can see, I now have only numeric values in my expression :

date_saisie.autoCalendar.Week    -> numeric since I use autoCalendar.Week (date_saisie = order date)

$VCurrentWeekNum    -> new variable that I have set to 40 (I will then set it to week(now(()


Any help would be appreciated

andrey_krylov
Specialist
Specialist

Hi, Patrice. You're right and if you convert Week field into numeric it should work.Try this then

sum({< Week = {"$(='<=' & num(week(now()),'00'))"} >} qte_commandee)

patricesalem
Creator II
Creator II
Author

Thanks for your help, it did work

patrice