Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

aggr result in a text box

Hello All,

Below is the scenario

There is a date field D1. Each record is to be subtracted from today() and the difference is to be summed up.

The sum is to be shown in a text object.

Please help with the possible solution

Regards,

Priya

Tags (2)
11 Replies
Highlighted
Master III
Master III

Re: aggr result in a text box

hi

in text object add like this

=sum(filed)

Highlighted
Not applicable

Re: aggr result in a text box

Hi Arul

Value in need is the sum of all the differences for each date value.

To be more clear,

D1

5th Jan

6th Jan

today() - 20th Jan

difference

15

14

sum of difference is 29

if we use only sum(difference) we dont get a value.

Thanks.

Highlighted
Master III
Master III

Re: aggr result in a text box

can you sample source like excel

Highlighted
Master III
Master III

Re: aggr result in a text box

i am getting 29 see this

Capture.JPG

Highlighted
Not applicable

Re: aggr result in a text box

Hi,

There is just one column as a source

it is a date value

Load * inline

[

D1

5/1/2015

6/1/2015

];

today() is a function in qlikview which results today's date.

D1-today() is to be calculated and the sum of the difference is to be shown in a text object.

Highlighted
Not applicable

Re: aggr result in a text box

Hi

Please note that, today() is not to be used inside script, since we wont get the real time value unless it is reloaded.

we want to write the expression in UI.

Highlighted

Re: aggr result in a text box

Hi,

Then in any text box write

=Sum( Interval(Today() - D1,'D') )

Also you can create the field in the load script

Ex:-

LOAD Interval(Today() - D1,'D')  as Diff,*;

LOAD Date(Date#(D1,'DD/MM/YYYY'),'DD/MM/YYYY') AS D1;

Load * inline
[
D1
5/1/2015
6/1/2015
]
;


And then use

Sum(Diff)

Regards

Anand

Highlighted
Specialist
Specialist

Re: aggr result in a text box

hi try like this

sum(day(Date(filed)))

Highlighted

Re: aggr result in a text box

Hi,

Then you have to use only this expression

=Sum( Interval(Today() - D1,'D') )


This gives 29 if you have two dates only


Regards

Anand