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

calculating formulas in crosstables

Hi, I'm a bit puzzled on a (for me as beginner) complex situation

I try to explain it with a simple table

Let's say I have a crosstable:

Capture.JPG

I load it in a crosstable, no problem:

tbl_Stocks:
CrossTable([Product], Data, 2)
LOAD Country,
Stocktype,

FROM
C:\model.xlsm
(ooxml, embedded labels, table is Totals);

I will now explain Stocktype :

T is total stock

P is production stock

now for some graphs i would like to see what amounts are in the market M, by doing M = T - P, per Product

Thanks!

1 Reply
swuehl
MVP
MVP

Try creating a straight table chart with dimension Product and

=sum({<Stocktype={T}>} Data) - sum({<Stocktype={P}>} Data)

as expression.

This is the set analysis equivalent of

=sum(if(Stocktype='T',Data)) - sum(if(Stocktype='P',Data))

Hope this helps,

Stefan