Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
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?

18 Replies
nikhilgarg
Specialist II
Specialist II
Author

mto‌, Can you help me in this?

Anil_Babu_Samineni

Can you attach sample QVF file to test

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
OmarBenSalem

What is the format of your field Month?

nikhilgarg
Specialist II
Specialist II
Author

Hey,

There is restriction to copy files from server to local. So, can not attach the file

nikhilgarg
Specialist II
Specialist II
Author

Hey,

The follwoing expression is working fine:

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

But when i tried to execute with following expression, it is not working fine:

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

Anil_Babu_Samineni

As I said, you could use double quotes for variable. Aren't you?

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
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

OmarBenSalem

see if the month is numerica; or create a numeric field : num(..)

and put it into " " not single quotes

nikhilgarg
Specialist II
Specialist II
Author

Thanks, it helps. Can you help em in this?

Which browser to use on mobile for qliksense app