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

Sumifs of different fields from different tables

Hi everyone. I am new to Qlik Sense. My concern is

I have table includes 1) Trial balance includes one fields  for codes as 100,101 etc (length 3)     2) other one as  1001,1010 (length 4)    3) Total of codes      (total 3 fields)

TB:

Code1;Code2;Total

100;1000;20

100;1001;30

101;1010;40

101;1011;50

When ı am preparing the table analysis, ı have some definition like as below

*Interest Income  should be sum of  100 (form Code 1)

*Interest Expense  should be sum of  1010 (form Code 2)

*Commission should be sum of  101 (form Code 1) 

Is there any way to differentiate  the formula for different lines of table?(like sumifs etc.)(expression)

Best Regards

 

10 Replies
BrunPierre
Master
Master

For Interest Income use any

Sum(IF([Code 1]='100',YourMeasure]))

or

Sum({<[Code 1]={100}>}YourMeasure)

 

 

EAK
Contributor
Contributor
Author

Thanks  Petre. ıt is ok , how about second  condition. Their measure ise same but conditiona is not sana ( from different fiields)

and it should be one expression?

thanks

BrunPierre
Master
Master

Sum({<[Code 2]={1010 }>}YourMeasure) //Interest Expense

Sum({<[Code 1]={101}>}YourMeasure) //Commission 

EAK
Contributor
Contributor
Author

it is ok but ı need code 2 for interest expense 

some the lines linked to code 1 sonr of them code 2

so I need one expression which includes code1 and code 2 together( both Codes are from different fileds)

thanks a lot.

BrunPierre
Master
Master

I have corrected the Interest expense with code 2.

So what's the definition for that one expression?

 

 

 

EAK
Contributor
Contributor
Author

Since the left Side of table is profit and loss statement items , linkage of the lines may be different . When ı set at one expression, qlik use formula for all lines which ı dont  need 

İf one condition is true go field code 1 and sum total if not go field code 2 and sum Total 

thats the why I need one expression which I üsse at table

BrunPierre
Master
Master

Need some more clarity on your logic.

What is the actual condition? And if it's true what are you looking for in Code 1? If it's false what are you looking for in code 2?

EAK
Contributor
Contributor
Author

7D451478-EEE5-4161-9DBB-FA00CCFC7206.jpeg

BrunPierre
Master
Master

With reference to the table, try this

SUM(IF([Code 1]='100',Total,IF([Code 2]='1010',Total)))