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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Sum between date

Hi,

I need sum a values between two data, but this date don't  have any relationship.

In my dimension a have a package, and this package have a initial date and final date, so a have other table witch have a date and a values, i have tried did something like:

SUM({$< AP_DATA_VMD = {">= $(=AP_AGEN_PAI_DTINI <=$(=AP_AGEN_PAI_DTINI"}>} AP_VAL_VMD)

But not work...

Capturar.JPG

Someone can help me?

1 Solution

Accepted Solutions
sunny_talwar

May be using Aggr()

Sum(Aggr(If(AP_DATA_VMD >= AP_AGEN_PAI_DTINI and AP_DATA_VMD <= AP_AGEN_PAI_DTINI, AP_VAL_VMD), YourCharDimensionsHere))

View solution in original post

5 Replies
avinashelite

You don't have the relation between AP_DATA_VMD and AP_AGEN_PAI_DTINI dates rite

Push the start and end date values to a variable and use the same you will get results

SUM({$< AP_DATA_VMD = {">= '$(vStart)'<='$(vEnd)'}>} AP_VAL_VMD)


vStart

=min(AP_DATA_VMD ) // change according to your requirement

vEnd

=max(AP_DATA_VMD )

Anil_Babu_Samineni

May be try this?

Sum(AP_DATA_VMD+AP_AGEN_PAI_DTINI)

Or

Sum(Num(AP_DATA_VMD)+Num(AP_AGEN_PAI_DTINI))

Or finally, may be this

SUM({$< AP_DATA_VMD = {">= '$(vStart)'<='$(vEnd)'}>} AP_VAL_VMD)// vStart is may be min and similar to max.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

May be using Aggr()

Sum(Aggr(If(AP_DATA_VMD >= AP_AGEN_PAI_DTINI and AP_DATA_VMD <= AP_AGEN_PAI_DTINI, AP_VAL_VMD), YourCharDimensionsHere))

yoganantha321
Creator II
Creator II

hi Silva,

May be this will be useful

Date#([field1], 'MM/DD/YYYY') > 0,Today() +Date#([field2], 'MM/DD/YYYY') as field

Anonymous
Not applicable
Author

Thanks everyone for help,

But the problem was in my script, because i used "Concatenate". I fixed my script and  the Sunny code it worked...

I wanted use set analysis, but the date need be a variable, and my date is dynamics...

Thanks again community!!!