Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
parakorn
Contributor II
Contributor II

Sum by 2 Criteria

Hi,

I want to merge 2 formulas into one in Qlikview expression.

Formula 1 : =Sum({$<Item_Type = {'N'} >}  [Total Sales])

Formula 2 : = Sum ({$<REFERENCE= p({1< [Product Code] = {'0000048565660'}>} REFERENCE) >} [Total Sales])

 

Thk very much.

Parakorn.T

 

 

 

Labels (1)
7 Replies
MendyS
Partner - Creator III
Partner - Creator III

parakorn
Contributor II
Contributor II
Author

Hi Sir

Thk for link, I try to learn and adapt to my formulas but criteria 2 does not work, the result is still equal at last.

I don't know what is wrong.

A New Formula

=Sum({$<Item_Type = {'N'} >+$<REFERENCE= p({1< [Product Code] = {'0000048565660'}>} REFERENCE) >} [Total Sales])

 

 

MendyS
Partner - Creator III
Partner - Creator III

@parakorn 

try this - 

Sum({$<Item_Type = {'N'} ,REFERENCE= p({1< [Product Code] = {'0000048565660'}>} REFERENCE) >} [Total Sales])

agigliotti
Partner - Champion
Partner - Champion

Hi @parakorn ,

What is your actual result and the expected one ?

What is the business logic behind the expression ? what are you trying to achieve ?

Best Regards

parakorn
Contributor II
Contributor II
Author

Thk you sir

I received 2 formulas from QV report of my company,

One Sumif by type of sales 'N'

and Two Sum-only tickets had item '0000048565660' in the lists then

I want to Sumif by type 'N' and the only ticket had item '0000048565660'

Sorry if you don't understand, I'm not good at Eng languages.

 

 

parakorn
Contributor II
Contributor II
Author

The result is still equal, I want to filter bills that had Item '0000048565660' and Item_Type = 'N' and sum that.

 

MendyS
Partner - Creator III
Partner - Creator III

@parakorn 
It should be equal,
there is one formula with 2 conditions,
can you please send some examples for the input and the output that you expect?