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: 
Not applicable

Help with expression

I need help with an expression that I am using in a straight table to calculate a weighted average.

This is the expression:

=(Field_1*Field_2) /

(sum(total if((STATUS <> 'X' and STATUS <> 'C') and (DESC = 1 or DESC = 3 or DESC = 7), Field_2)))

I need the denominator to remain the same regardless of the current selection, but it is changing when I make a selection. How do I prevent this? I should note that putting a {1} won't work since I am looking at data based on the date so I need to leave that filter in place.

Thank you!

3 Replies
sunny_talwar

Unless you put {1}, your denominator of your expression will change. You can may be tell it to change on date and not on anything else:

{1<Date = {'*'}>}

HTH

Best,

Sunny

pokassov
Specialist
Specialist

Hi Matthew!

Can you attach your model?

sunny_talwar

Try this expression (replace Date with your date field name)


=(Field_1 * Field_2) /

(Sum({1<Date = {'*'}>} TOTAL If((STATUS <> 'X' and STATUS <> 'C') and (DESC = 1 or DESC = 3 or DESC = 7), Field_2)))



Best,

Sunny