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

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

Set analysis if statement

I need a little help with the following set analysis statement.

If (SALES_PERSON='John',                                     // if sales person = john

Avg({<MetricName={OverallScore}>} Sales_Formula) // then take the average of the following sales

$(vCustomSale))                                                     // otherwise return this variable

Does this look ok (format wise ) as it doesnt seem to work ?

7 Replies
vishsaggi
Champion III
Champion III

May be this?

If (SALES_PERSON='John', Avg({<MetricName = { 'OverallScore' }>}  Sales_Formula), '$(vCustomSale)' )

sunny_talwar

Does one part of the if condition doesn't work or the whole thing doesn't work? May be missing a comma?

If (SALES_PERSON='John',                                    // if sales person = john

Avg({<MetricName={OverallScore}>} Sales_Formula), // then take the average of the following sales

$(vCustomSale))                                                    // otherwise return this variable

Anonymous
Not applicable
Author

Thanks. The comma should have originally been included - was just a typo. With this though what it does is 'only' show me sales for John ...

sunny_talwar

Okay so we know that this is working

Avg({<MetricName={OverallScore}>} Sales_Formula)

The issue is with $(vCustomSale) then? What is the expression behind this variable?

Anonymous
Not applicable
Author

Yes exactly, Avg({<MetricName={OverallScore}>} Sales_Formula) works fine.

The expression behind $(vCustomSale)  is Round(Avg(AreaCustomScore),1)

zebhashmi
Specialist
Specialist

Try this

$(=vCustomSale)

Anonymous
Not applicable
Author

Unfortunately this didn't work.