Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
nikhilgarg
Specialist II
Specialist II

Error in Expression

Hello All,

I am stuck in one issue in QLIKSENSE.

I have created a variable vCurMonth = "=Month(Today())"

I am calculating Sum(Amount) as:

Sum({<Year = {'$(vCurYear)'},Month = {'<=$(vCurMonth)'},[Transaction Type] = {'Sales'}>}Amount)

Above expression is not working because of following clause:

Month = {'<=$(vCurMonth)'}


Can anyone help me in this?

1 Solution

Accepted Solutions
kkkumar82
Specialist III
Specialist III

Hi Nikhil,

If you take filter for Month, is it showing up MonthNames like Jan, Feb... or 1,2,3.

If they are showing up names then it might be the reason why <= condition is not working, create MonthNum columns

so they hold and in variable also used =Num(Month(Today()))

Hope this helps

View solution in original post

18 Replies
arulsettu
Master III
Master III

hi try like this

Month = {'<=$(=vCurMonth)'}


and for year its working ?


Clever_Anjos
Employee
Employee

Month = {'<=$(=vCurMonth)'}

nikhilgarg
Specialist II
Specialist II
Author

Hey,

With year it is working fine. I tries your way also in KPI oblject but it is not working fine for Month variable. Pls find attached snapshot

nikhilgarg
Specialist II
Specialist II
Author

Hey,

With year it is working fine but with month as suggested by you, it is not working fine. Pls find attached snapshot

Clever_Anjos
Employee
Employee

Is it possible to attach your qvf?

Anil_Babu_Samineni

May be with Double Quotes?

Sum({<Year = {'$(vCurYear)'},Month = {"<=$(vCurMonth)"},[Transaction Type] = {'Sales'}>}Amount)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
nikhilgarg
Specialist II
Specialist II
Author

Hey,

There is restriction to copy from server to any other location so unfortunately cannot paste qvf. IF you could still help, would be great

nikhilgarg
Specialist II
Specialist II
Author

Tried this but didnt worked.

giakoum
Partner - Master II
Partner - Master II

Is month a number? Maybe you need the Date and Date# function to make this work