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: 
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
MVP
MVP

maybe this:

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

I hope it helps.

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it

View solution in original post

3 Replies
agigliotti
MVP
MVP

maybe this:

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

I hope it helps.

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
MayilVahanan
MVP
MVP

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