# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Action-Packed Learning Awaits! QlikWorld 2023. April 17 - 20 in Las Vegas: REGISTER NOW
cancel
Showing results for
Did you mean:
Partner - Creator III

## Date calculation help

I have the following formula:

= sum({\$<[TransactionLinesDate] = {'>=\$(=Date(vStartDate))<=\$(=Date(vEndDate))'},

[TransactionLinesType] = {'I', 'C', 'T'}>}

TransactionLinesAmount)

vStartDate and vEndDate are typically the beginning of the month so we may have value 01/01/2015 (42005) and 01/02/2015 (42036).

I want to repeat the above calculation but for the month before - in other words instead of calculating for start of January until start of February, I want start of December 2014 to start of January 2015....

In other words I want vStartDate and vEndDate to be adjusted by one less month.

I have even tried the following and cannot get it to work...

:

= sum({\$<[TransactionLinesDate] = {'>=\$(=Date(vStartDate - 31))<=\$(=Date(vEndDate - 31))'},

[TransactionLinesType] = {'I', 'C', 'T'}>}

TransactionLinesAmount)

Any help would be greatly appreciated...

1 Solution

Accepted Solutions
Partner - Creator III
Author

Thanks Anbu

I adapted what you suggested and got the desired result with the following - for some reason I was not getting the desired result with Date# and the formatting:

[TransactionLinesType] = {'I', 'C', 'T'}>}

TransactionLinesAmount)

Thanks

Alexis

4 Replies
Master III

[TransactionLinesType] = {'I', 'C', 'T'}>}

TransactionLinesAmount)

Partner - Creator III
Author

Thanks Anbu

I adapted what you suggested and got the desired result with the following - for some reason I was not getting the desired result with Date# and the formatting:

[TransactionLinesType] = {'I', 'C', 'T'}>}

TransactionLinesAmount)

Thanks

Alexis

Master III

If the values stored in vStartDate and vEndDate are date, then you can directly use Addmonths() without Date()

Partner - Creator III
Author

vStartDate and vEndDate are numeric (e.g. 42005 for 01/01/2015) hence why I "Date" them and then deduct 1 month as you suggested.

Thanks again

Alexis

Community Browser