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

EXPRESSION HELP PLEASE

=IF(GetSelectedCount(LuCurrencyType3) > 0,

sum(IF(wildmatch([Type],'*Book*')=1,[Amount ]*Factors3)/Factors3),

sum(IF(wildmatch([Type],'*Book*')=1,[Amount ]*Factors3)))

Is there anything wrong in the above expression.

Below expression is working fine but when I add If to filter out amount for book it is not working.Is there any other way to write the above expression?

=IF(GetSelectedCount(LuCurrencyType3) > 0,

sum([Expense]*Factors)/[Factors3],

sum([Expense]*Factors))

1 Solution

Accepted Solutions
sunny_talwar

May be this:

=IF(GetSelectedCount(LuCurrencyType3) > 0,

sum(IF(wildmatch([Type],'*Book*')=-1,[Amount ]*Factors3)/Factors3),

sum(IF(wildmatch([Type],'*Book*')=-1,[Amount ]*Factors3)))

or


=IF(GetSelectedCount(LuCurrencyType3) > 0,

sum({<Type = {'*Book*'}>} [Amount ]*Factors3)/Factors3),

sum({<Type = {'*Book*'}>}[Amount ]*Factors3)))

UPDATE: I would suggest using the set analysis method rather than if statement (2nd expression above)

View solution in original post

4 Replies
sunny_talwar

May be this:

=IF(GetSelectedCount(LuCurrencyType3) > 0,

sum(IF(wildmatch([Type],'*Book*')=-1,[Amount ]*Factors3)/Factors3),

sum(IF(wildmatch([Type],'*Book*')=-1,[Amount ]*Factors3)))

or


=IF(GetSelectedCount(LuCurrencyType3) > 0,

sum({<Type = {'*Book*'}>} [Amount ]*Factors3)/Factors3),

sum({<Type = {'*Book*'}>}[Amount ]*Factors3)))

UPDATE: I would suggest using the set analysis method rather than if statement (2nd expression above)

cesaraccardi
Specialist
Specialist

Hi,

Yes you could use set analysis.

=IF(GetSelectedCount(LuCurrencyType3) > 0,

sum({$<Type={'*Book*'}>} [Expense]*Factors)/[Factors3],

sum({$<Type={'*Book*'}>} [Expense]*Factors))

Not applicable
Author

Thank to you as always !

sunny_talwar

No problem