Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Where Expression Using Conditions on Two Fields

Hi

I'm trying to create a variant on the following which also filters qICost_standard04 on cSource in the second two clauses. 

=-(sum( {$<cSource = {'OP'}>} qTotalFCost )
+
Sum( {$<cCategory = {'Direct'}>} qICost_standard04 )
+
Sum( {$<cCategory = {'Indirect'}>} qICost_standard04 ))

In SQL I would just use

SELECT qICost_standard04

WHERE cCategory = 'Direct'

AND cSource = 'OP'

Have tried assorted variations of brackets and <> and just becoming frustrated.

Any help would be much appreciated.

Cheers

Geoff

 

1 Solution

Accepted Solutions
Gysbert_Wassenaar

try: Sum( {$<cSource = {'OP'}, cCategory = {'Direct'}>} qICost_standard04 )

to get the sum of qlCost_standard04 where cSource = 'OP' and cCategory = 'Direct'

cCategory = {'Direct','Indirect'} is the selector for the sql equivalent cCategory in ('Direct','Indirect')


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

try: Sum( {$<cSource = {'OP'}, cCategory = {'Direct'}>} qICost_standard04 )

to get the sum of qlCost_standard04 where cSource = 'OP' and cCategory = 'Direct'

cCategory = {'Direct','Indirect'} is the selector for the sql equivalent cCategory in ('Direct','Indirect')


talk is cheap, supply exceeds demand
Not applicable
Author

Cool, sorted thanks Gysbert