Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Modify expression

Hi,

Please help me to modify expression avg({1} MyField)

I want to show avg of all, but manage by Filter MYear.

In my case if I select any month in MYear, it shows trend for all month.

Thanks,

1 Solution

Accepted Solutions
whiteline
Master II
Master II

=avg({1<MYear=P(MYear)>}MyField)

View solution in original post

13 Replies
Not applicable
Author

did you try creating a bookmark (Clear Other Fields - MYear)

and changing your expression to :  avg( {MyBookMark} MyField?

Anonymous
Not applicable
Author

Thanks for reply,

Bookmark doesn't work when you publish it.

Cheers,

Not applicable
Author

did you try combine getfieldselection() ?

something like 

avg({1<MYear={getfieldselections(MYear)}>} MyField)

Anonymous
Not applicable
Author

Something's wrong.

avg({1<MYear={getfieldselections(MYear)}>} MyField)

getfieldselections(MYear)}>}  ----it doesn't reconise command.

Not applicable
Author

it was only an idea

but i'll try to write it myself

Anonymous
Not applicable
Author

I tried like it

avg(TOTAL<MYear> MyField).

It doesn't work with Filter

Not applicable
Author

if you select always one year this should work

sum({1<MYear={'$(=GetFieldSelections(MYear))'}>}MyField)

does this satisfy you?

Not applicable
Author

=sum({1<MYear={$(=GetFieldSelections(MYear,','))}>}MyField)

//i just remove ' sign

Anonymous
Not applicable
Author

It doesn't work.

I just copied your expression and fixed MyField.