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

subquery in measure

Hi!

Ich have a central stock and a few other stocks which are all supplied by the central stock. In a table for each stock all articles with quantity is listed. 

In my app I want to visualize a table where I have the list of articles with the stock the article is available in and the quantity of the article in this stock. In addition I want to have a column where the quantity of the central stock of this article is listed. 

Is there a way to select the quantity of the central stock only in a measure of this table? I don't want to select it via subquery in loading script, because it increases the loading time massively and I don't have any option to edit the database.

Example:

ArticleStockQuantityQuantity Central Stock
Book ABerlin310
Book ALondon510
Book BBerlin1020
Book ACentral Stock1010
Book BCentral Stock2020

 

Thank you in advance!

1 Solution

Accepted Solutions
JuanGerardo
Partner - Specialist
Partner - Specialist

Hi @QlikCommSa , what about this?:

Sum({<Stock={'Central Stock'}>} TOTAL <Article> Quantity)

JG

View solution in original post

4 Replies
Lauri
Specialist
Specialist

Did you try Set Analysis? 

Sum({<Stock={'Central Stock'}>} Quantity)

QlikCommSa
Contributor III
Contributor III
Author

Sure, but then only the rows where Stock = Central Stock have nonzero quantities in column "quantity central stock"

JuanGerardo
Partner - Specialist
Partner - Specialist

Hi @QlikCommSa , what about this?:

Sum({<Stock={'Central Stock'}>} TOTAL <Article> Quantity)

JG

QlikCommSa
Contributor III
Contributor III
Author

Great, that's what I was looking for. Thank you JuanGerardo!