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: 
publication1
Contributor III
Contributor III

Sum Where issue - Data is between two tables

Im trying to get a SUM of number of items within a table where it matches another table. Ill keep it simple

 

Table one  has columns (Item_Count, Item_floor)

Table two has (Item_floor)

Im trying to sum Item_count) where Item_floor is a match in both tables

 

I have tried this method

Sum({<[TABLE_ONE.ITEM_FLOOR]=[TABLE_TWO.ITEM_FLOOR]>}[ITEM_COUNT]) - This gives me an output of 0

I have also tried this method

=if([TABLE_ONE.ITEM_FLOOR]=[TABLE_TWO.ITEM_FLOOR],Sum(ITEM_COUNT),'N') - This is giving me an output of N

 

Thanks in advance for your time 🙂

Labels (1)
1 Solution

Accepted Solutions
agigliotti
Partner - Champion
Partner - Champion

maybe this:

=Sum( if( [TABLE_ONE.ITEM_FLOOR] = [TABLE_TWO.ITEM_FLOOR], ITEM_COUNT, 0 ) )

I hope it helps.

View solution in original post

3 Replies
agigliotti
Partner - Champion
Partner - Champion

maybe this:

=Sum( if( [TABLE_ONE.ITEM_FLOOR] = [TABLE_TWO.ITEM_FLOOR], ITEM_COUNT, 0 ) )

I hope it helps.

MayilVahanan

Hi 

In TableB, you can bring one dummy field like below

TableB:

Load ITEM_FLOOR, 1 as dummy from datasource;

And use in set analysis like

Sum({<dummy={1}>}[ITEM_COUNT])

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
publication1
Contributor III
Contributor III
Author

exactly what I was after, thank you