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

Announcements
Join us in Zurich on Sept 24th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with set Analysis.

My Expression :

=Avg({<flag={'OriginScore'},KPI=,Month={"<=6"}>}Score)

It work fine

however i want to replace number 6 with only(Month)

=Avg({<flag={'OriginScore'},KPI=,Month={"<=only(Month)"}>}Score)

it fail to produce the result.

did anyone can help ?

1 Solution

Accepted Solutions
mike_garcia
Specialist
Specialist

In order to use the Only() function you must have only one possible (or selected) value in the Month field. If you have more than one selected value, you need to discriminate among them, by using the Max function, for instance.

Assuming the Field Month has numeric values, or values that have a numeric representation, you can try:

=Avg({<flag={'OriginScore'},KPI=,Month={"<=$(=Max(Month))"}>}Score)

Mike.

Miguel García
Qlik Expert, Author and Trainer

View solution in original post

3 Replies
mike_garcia
Specialist
Specialist

You need to use Dollar-Sign Expansion for the Expression to be evaluated.

Try:

=Avg({<flag={'OriginScore'},KPI=,Month={"<=$(=only(Month))"}>}Score)

Mike.

Miguel García
Qlik Expert, Author and Trainer
Not applicable
Author

i tried but it not working .It seem that i can't use expression inside " "

mike_garcia
Specialist
Specialist

In order to use the Only() function you must have only one possible (or selected) value in the Month field. If you have more than one selected value, you need to discriminate among them, by using the Max function, for instance.

Assuming the Field Month has numeric values, or values that have a numeric representation, you can try:

=Avg({<flag={'OriginScore'},KPI=,Month={"<=$(=Max(Month))"}>}Score)

Mike.

Miguel García
Qlik Expert, Author and Trainer