Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
zenobendi
Contributor III
Contributor III

Sum values between two specific days/months but for all years

Goodmorning, 

I am trying to create a chart that shows a sum of the values subdivided by years. And since here there are no problems, but I am trying to put a line that shows the values between a specific period (01/01/... - 06/30/....) so that doesn't depend on the year. And my values are all based on a date field called Mov_DocDataRiferimento.

 

Is there a way to achieve this goal? 

Thanks,

 

Zeno

1 Solution

Accepted Solutions
micheledenardi
Specialist II
Specialist II

Probably the most correct solution is to create a new field [Flag First 6 Months] in load script then use it in your expression:

So, the flag should be something like this:

if(num(Month(Mov_DocDataRiferimento))<=6,1,0) as [Flag First 6 Months]

 

Then, if you create [Flag First 6 Months] in master calendar you can use:

Sum(Value*[Flag First 6 Months])

Otherwise, if you create the flag in your fact table, the expression will be:

Sum({<[Flag First 6 Months]={1}>}Value)

 

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

1 Reply
micheledenardi
Specialist II
Specialist II

Probably the most correct solution is to create a new field [Flag First 6 Months] in load script then use it in your expression:

So, the flag should be something like this:

if(num(Month(Mov_DocDataRiferimento))<=6,1,0) as [Flag First 6 Months]

 

Then, if you create [Flag First 6 Months] in master calendar you can use:

Sum(Value*[Flag First 6 Months])

Otherwise, if you create the flag in your fact table, the expression will be:

Sum({<[Flag First 6 Months]={1}>}Value)

 

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.