Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Sum Date Range

Hi All,

I have the following sum date range that I need some help.  Everything works fine until I added a new field "Type".

=Sum({<My_Date = {"$(='>='& Date(vDateStart) & '<=' & Date(vDateEnd))"}>}+1000) + Sum(Amount)

For Example:  I have2 variables, Start and End date where I want to increase by 1000.

  • I have selected 5/1/16 & 5/1/16 ; both of these dates have zero amount
  • I want to increase by 1000
  • If you look at the Sum Range column highlighted in green, Amount were off. I expect date range 5/1 and 5/2 to be 1000

   

FundCompanyMy_DateTypeOriginal AmountSum Range
ABCDEFG7/1/2015Cost-1,000,000-1,000,000
ABCDEFG7/2/2015Cost-2,000,000-2,000,000
ABCDEFG8/1/2015Proceeds750,000750,000
ABCDEFG8/7/2015Proceeds5,0005,000
ABCDEFG8/14/2015Proceeds1,250,0001,250,000
ABCDEFG9/4/2015Proceeds1,0001,000
ABCDEFG9/18/2015Proceeds1,000,0001,000,000
ABCDEFG05/01/2016Cost01,000
ABCDEFG05/01/2016EMV01,000
ABCDEFG05/01/2016Proceeds06,000
ABCDEFG05/02/2016Cost02,000
ABCDEFG05/02/2016EMV02,000
ABCDEFG05/02/2016Proceeds07,000

Any inputs will greatly appreciated!

Thanks,

Frank

16 Replies
Anonymous
Not applicable
Author

show's zero for the date range I selected.

I don't think it's filtering out. If I selected "Cost" for example with added amount of 1000, the other trans type for this date range fill in all with 1000, not just to "cost".

sunny_talwar

Hmmmm. let me test it out

sunny_talwar

The version I am checking in seems to filter out the results where Trans Type is not selected. Can you share a sample where this is not happening for you?

sunny_talwar

Can you check if RangeSum(2) is working the way you would expect?

Capture.PNG

Anonymous
Not applicable
Author

it's works when I click on either of the TransType but if I clear it, the amount shows up on all TransType. Is it possible the rest of the TransType show's zero just "Cost" with1000 for the date range when I clear the listbox?

sunny_talwar

So are you saying when Nothing is selected Cost is the only one that should have 1000 and if the user select something else, then that one gets the value and rest all become 0?

Anonymous
Not applicable
Author

No

Yes, If user selected something, only that type should gets  the value and the rest should be zero. I think your range 2 works but if I clear the selection everything fills in with 1000.  I guess, selection what trigger this 1000 in the range 2 sum. Maybe I think too much to retain that value even if I clear the selection.

I should be good with the range 2 sum.. Thanks again Sunny!!