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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sums based on days of start date to end date

Hi guys,

Based on the following image, I've manage to get the total days from Posting Date to 30-01-2014 and from there I created an expression for each column, say for column "61 - 90 days" this is the expression:

=if(vDummyDate - [Posting Date] >= 61 and

    vDummyDate - [Posting Date] <= 90,

    SUM([Remaining Quantity]), ' ')

But if I remove the Posting Date column and wanting something like the following image, the expression doesn't seem to work.

Can somebody point me out where have I done wrong? Any suggestions/advices/opinions are greatly appreciated.

Thank you for your kind attention guys!

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try Sum(If(  rather than If(Sum( , Like:

=Sum(if(vDummyDate - [Posting Date] >= 61 and

    vDummyDate - [Posting Date] <= 90,

    [Remaining Quantity]))

View solution in original post

6 Replies
sujeetsingh
Master III
Master III

In expression use max() or maxstring()

Not applicable
Author

Hello sujeetsingh

Thank you for your reply but I couldn't get what you mean by using max() or maxstring()

tresesco
MVP
MVP

Try Sum(If(  rather than If(Sum( , Like:

=Sum(if(vDummyDate - [Posting Date] >= 61 and

    vDummyDate - [Posting Date] <= 90,

    [Remaining Quantity]))

sujeetsingh
Master III
Master III

post a sample plz

Not applicable
Author

try this

=if(vDummyDate - max([Posting Date]) >= 61 and

    vDummyDate - max([Posting Date]) <= 90,

    SUM([Remaining Quantity]), ' ')

Not applicable
Author

hi tresesco,

thank you! got the correct one .

and the rest, thank you so much for your kind attention! really appreciate it