Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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
Not applicable

Re: calculating formulas in crosstables

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