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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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

 

Labels (1)
1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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
Partner - Champion III
Partner - Champion III

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