Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Summing a column then subtracting two dates

Hi all,

I am summing the totals for each measured day which is right when looking at one days worth of data in a column, but when I highlight two dates I want them to subtract each other and show in a column.

For example, the first column ‘unassigned’ should read 4/29/14 – 4/28/14
= (10,001).

It is reading  (4/29/14) 309,719 + (4/28/2014) 299,718 = 609,437 which is

Is this possible in Qlik? I attached a screen shot.

Thank you,


4 Replies

Re: Summing a column then subtracting two dates

Could you upload a small sample application to demo your data model and current analysis?

This will help us to help you.

In general, using all records in your current selection within the aggregation is standard behaviour of QV analysis, so a

sum(VALUE) will sum up all values, limited by your date selections and grouped by the dimensions in the chart, but will not apply any different logic like calculating differences by default. So you would need to tell QV what do to, either in your chart expressions or maybe possibly in the script.

But as said, to help you more, I think you need to detail your requirements and settings, the screenshot is not giving enough information to help you.

Not applicable

Re: Summing a column then subtracting two dates

Thank you Swuehl for the reply!

I was given these two formulas as well, but could not get them to work correctly.

Sum({$<Date={$(=Only(Date)-1)}>}LineSalesAmount) for the
previous day and

Sum({$<Date={$(=Only(Date)}>}LineSalesAmount) for the
current day.

Where can I upload a sample at? I am not seeing a link to add the qvw file.

Esteemed Contributor III

Re: Re: Summing a column then subtracting two dates

In the "Reply" window, find "Use advanced editor" on the top right.  When you click it, there will be Attach on the bottom right.

Not applicable

Re: Re: Re: Summing a column then subtracting two dates

Thank you Michael!

Community Browser