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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Nina
Contributor
Contributor

Can't get average function to run

Hello,

I try to set up an expression in a text field. It is not working. I always get "Error: Error in set modifier expression" and the expression is underlined from the closing curly bracket on.

The expression:

=Avg({1<location={London}, Month(target_production_day)=Month(Now()-1)>} production_time)

So, I want to calculate and show the average production time of all entries, which are referring to London in the last month.

Does someone has an idea, what the mistake is here?

Thanks

Nina

2 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You can't use a function on the left side of = in the set modifier.  Instead try this:

=Avg({1<location={London}, target_production_day={"=InMonth(target_production_day, today(2), -1)"}>} production_time)

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

Harrism05
Contributor
Contributor

Cause: The cell is formatted as Text, which causes Excel to ignore any formulas. This could be directly due to the Text format, or is particularly common when importing data from a CSV or Notepad file. Fix: Change the format of the cell(s) to General or some other format.

 

 

Dunkinrunsonyou