Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
Not applicable

subtraction of 2 records

Hi

I need to substract two values of 'Volume' within the following table depending on 'Date' but have no clue how to do that

The logic should be: 'Volume' of maxString(Date,1) - 'Volume' of maxSting(Date,2) [here 20'000-10'000]

Date Volume
30.06.2009 5'000
01.07.2009 10'000
03.07.2009 20'000

Has anybody an idea how to do that?

Many Thanks!!

1 Solution

Accepted Solutions
Not applicable

subtraction of 2 records

Hi Raghu,

Here is your application.

Data for date in your application is interpreted as string earlier. Because that max was not working.

Here you go. Working version of yours.

- Sridhar

View solution in original post

4 Replies
Not applicable

subtraction of 2 records

Hi,

Below expression will do job for you.

=sum(if(max(total Date) = Date,Volume)) - sum(if(max(total Date,2) = Date,Volume))

- Sridhar

Not applicable

subtraction of 2 records

check the attachment. It's gives zero. Two expressions gives the same result

sum(if(max(total Date) = Date,Volume)) = 20000

sum(if(max(total Date,2) = Date,Volume)) = 20000

-Raghu

Not applicable

subtraction of 2 records

Hi ,

Check this attached app.

I have used this for test the that code.

- Sridhar

Not applicable

subtraction of 2 records

Hi Raghu,

Here is your application.

Data for date in your application is interpreted as string earlier. Because that max was not working.

Here you go. Working version of yours.

- Sridhar

View solution in original post