Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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

Re: Help with expression

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
Valued Contributor

Re: Help with expression

Hi Matthew!

Can you attach your model?

Re: Help with expression

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

Community Browser