Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

month comparison

Hi

I am trying to compare the month of a date dd/mm/yyyy to a variable vMonth, which will contain the name of a month eg feb.

I want to be able to average all the sales where the month = vMonth.

I've played around with set analysis where I've tried to select the set where the month is = to vmonth but had no luck.

avg({$< Month(Date) = {'$(vMonth)'}>} sales)

1 Solution

Accepted Solutions
MayilVahanan

HI

Try like this

avg({$<MonthField = {'$(vMonth)'}>} sales)

Edit:

if you don't have month field, load in script like this

Load * , month(Date) as MonthField from tablename;

Hope it helps

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

View solution in original post

1 Reply
MayilVahanan

HI

Try like this

avg({$<MonthField = {'$(vMonth)'}>} sales)

Edit:

if you don't have month field, load in script like this

Load * , month(Date) as MonthField from tablename;

Hope it helps

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