Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
jblomqvist
Specialist
Specialist

Hello friends, How can I do annual totals for two columns but only monthly totals for other columns?

Hi all,

I have to create something like the following in a Pivot Table:

Company
Field
YearMonth
Assets
EquityMAT BITMAT BITA
CokeFood2015-01100,000250,0005,00010,000
CokeFood2015-02120,000300,0005,00010,000
CokeFood2015-0387,00056,0005,00010,000
PepsiFood2014-1295,00085,0007,0007,000

Dimensions = Company, Field, YearMonth, Type (this is the field that holds Asset, Equity, BIT, and BITA headings you see above)

Expression = e.g. Sum(Sales).

You can see in the above examples that values for Assets and Equity change for each YearMonth. However the value in MAT BIT and MAT BITA stays the same for every row for each company.

How can I get my Sum(Sales) expression to do this where MAT BIT AND MAT BITA shows results only for the last 12 months added up together, while fields like Assets and Equity change per month?

I am not sure how to do this in QlikView so please share if you know how to do this

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

If you want rolling-12 month sums you can try one of the approaches explained in this document: Calculating rolling n-period totals, averages or other aggregations


talk is cheap, supply exceeds demand
santhoo_san
Partner - Creator II
Partner - Creator II

Hi you can create a running month ID and use as below

Sum({<MonthID ={"<=$(=max(MonthID))>=$(=max(MonthID)-11)"}>}MAT BIT)

for asset and liability you can simply use sum, as you are using YearMonth as a dimension, it will automatically takes the relevant month's value