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: 
dcd123456
Creator
Creator

doubt about set expresion

Hello

i have a table with three columns Id, Date and Value, i need create a text objet that show the avg of the items that have a date in the current month. I try to use this expresions but don't work

IDDateValue
200000000105/04/201412
200000000308/06/201434
200000000405/04/20141
200000000615/05/201434
200000000701/06/201456
200000000805/05/2014123
200000000908/05/20146
200000001005/04/20142

Text Object:

='AVG Current month:  ' &avg({<Date={'month(today())'} >} Value)

or

='AVG Current month:  ' &avg({<month(Date)={'month(today())'} >} Value)

the first expresion don't return any value and the second show error...

i have attached an excample, anybody could help me.

thanks

regards

diego

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Create a month field in the script, like:

Load

          Month(Date) as Month

Then, try like: ='AVG Current month:  ' &avg({<Month={'$(=month(today()))'} >} Value)

View solution in original post

3 Replies
tresesco
MVP
MVP

Create a month field in the script, like:

Load

          Month(Date) as Month

Then, try like: ='AVG Current month:  ' &avg({<Month={'$(=month(today()))'} >} Value)

Anonymous
Not applicable

Try this:

avg(if(InMonthToDate(Date,today(),0),Value))

mahesh_agrawal
Creator
Creator

Hi,

Use the following expression. It will work.

=avg({$<Date={'>=$(=makedate(2014,month(today()),01))'}>}Value)