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: 
Anonymous
Not applicable

Less then equal to not working in set analysis

Hi Geniuses

I have a problem in set related with less then equal to

sum({$<Year = {$(vThisYear)}, Month = {"<=$(=vThisMonthText)"}>} [Product Bookings Net])

Above formula is not working when I am using less then equal to after month

require ur assistance

Thanks,

Shashnak

10 Replies
Miguel_Angel_Baeyens

Hi Shashnak,

Since your Month is in text, and less than or equal to is a numeric operator, this will not work. You will need to create an additional field in the script where the Month is stored in numeric value, like the Year, and use this new numeric field in the variable. That will fix it.

Hope that helps.

Miguel

Not applicable
Author

Hi Shashnak,

Can you attach a sample document? You may need an = in front of vThisYear What about:

sum({$<Year = {$(=vThisYear)}, Month = {"<=$(=vThisMonthText)"}>} [Product Bookings Net]) or

sum({$<Year = {"$(=vThisYear)"}, Month = {"<=$(=vThisMonthText)"}>} [Product Bookings Net])


Have you tried that?


Andy

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

If you created a field with Month() function. Then you can use <= operator but you should compare this with string.

May be something like this

Assuming that

vThisMonthText = Max(Month)

where Month field arrived from Month(DateField)

sum({$<Year = {$(vThisYear)}, Month = {"<=$(=vThisMonthText)"}>} [Product Bookings Net])

rbecher
MVP
MVP

This wont work since vThisMonthText is not numeric: '2' > '10'

Astrato.io Head of R&D
Not applicable
Author

Or you could use the Dual function right? Something like Dual(month, autonumber(month)) as month.

MayilVahanan

HI

Try like this

Use DateField, i think Month is in text format

SUM({$<DateField = {"<=$(=MonthStart(max(DateField)))"}>} [Product Bookings Net])


Hope that helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
kalyandg
Partner - Creator III
Partner - Creator III

hi,

try this

sum({$<Year = {$(vThisYear)}, Month = {"<=$(vThisMonthText)"}>} [Product Bookings Net])

Thanks,

Kalyan

Anonymous
Not applicable
Author

Hi Geniuses,

Please find attached qvw which I am refering to calculate YTD MTD

In this go the sheet set analysis static and go the pivot table at bottom u can see the formula there

he is comparing the text month with the number and getting desired result

in my case the variables are below

vThisMonth is number

vThisMonthText is text lik Aug sep

Month dimension is Aug Sep

now please enlighten me guys

Thanks

tresesco
MVP
MVP

Dear Shashank,

As already told by Celambarasan Adhimulam, you can use '<=' operator if the month values are created using  Month() function (you can notice the same in your referred application). So it could be a major point of consideration how you are creating this month field. Best way people here can help you, if you can upload your sample application.