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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
knightwriter
Creator III
Creator III

Sum 3 variables. How do I do it?

Hi gurus,

I have a query regarding an expression I am trying to use and I am hoping you can help me.

So I want to get:

1) The average of a total fees

2) In 2015

3) and status = Won

I have the below but I cannot get it to work. Any guidance is appreciated.

=Avg(Distinct If(InYear([opportunity.fee] and [Opportunity.Won Date], Today(), 0) and [Opportunity.Sales Stage]=vWon,[Id],))

Many thanks.

5 Replies
sunny_talwar

May be this:

=Avg({<Year = {'2015'}, Status = {'Won'}>}[Total fees])

knightwriter
Creator III
Creator III
Author

Hi Sunindia,

Thanks for the note but I still cannot manage to work it. The message is Error in expression. Any other suggestions?

sunny_talwar

Can you post a screenshot of when you enter the above expression in edit expression window?

jonathandienst
Partner - Champion III
Partner - Champion III

I am afraid the expression you posted does not make sense. This bit will likely give you an expression error (and will not work):

     InYear([opportunity.fee] and [Opportunity.Won Date], Today(), 0)

(the bold text returns a true/false value and not a date which InYear is expecting

Plus you have a trailing comma which will cause an error

     =vWon,[Id],))

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

And please give the definition of vWon

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein