Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

dcd123456
New Contributor III

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

Re: doubt about set expresion

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

Re: doubt about set expresion

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

mov
Esteemed Contributor III

Re: doubt about set expresion

Try this:

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

Highlighted
mahesh_agrawal
Contributor

Re: doubt about set expresion

Hi,

Use the following expression. It will work.

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