Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Chanty4u
MVP
MVP

Sum With Condition

Hi All,

I want  exclude only actual value for max quarter 

in the attached app i have mentioned the requirment and result too,

1 Solution

Accepted Solutions
qlikviewwizard
Master II
Master II

Hi Chanty 4u

Try like this.

=max({<Quarter={$(=concat(chr(39) & Quarter & chr(39),',') )}>}Actuals)+max({<Quarter={$(=concat(chr(39) & Quarter & chr(39),',') )}>}Forecast)

Capture.PNG

View solution in original post

9 Replies
Anil_Babu_Samineni

How about this?

Sum({<Quarter={"$(=MaxString(Quarter))"}>} Forecast)

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
Chanty4u
MVP
MVP
Author

No anil.  its showing only for max sum forecast i need  both selected means

max quarter forecast and other selected actual

qlikviewwizard
Master II
Master II

Hi Chanty 4u

Try like this.

=max({<Quarter={$(=concat(chr(39) & Quarter & chr(39),',') )}>}Actuals)+max({<Quarter={$(=concat(chr(39) & Quarter & chr(39),',') )}>}Forecast)

Capture.PNG

tresesco
MVP
MVP

This?

RangeSum(Sum({<Quarter={'$(=maxstring(Quarter))'}>}Forecast),Sum({<Quarter-={'$(=maxstring(Quarter))'}>}Actuals))

Capture.JPG

Chanty4u
MVP
MVP
Author

thanks Tresesco B

this is my original expression  how can i incorporate in this?

if(Quarter=vMaxQtr  and  otherQtr Selection ,$(vFc)+$(vAc))

tresesco
MVP
MVP

You might have to create two new variables for this, because you need to include set analysis in it.

raviityou
Partner - Creator
Partner - Creator

please find attached file,

Chanty4u
MVP
MVP
Author

this is my original expression  how can i incorporate in this?


here how can i use and condition in if  ?


=IF(Quarter = vNewMaxQtr,(($(vFCYOYServ)-$(vACTYOYServ)) / $(vACTYOYServ))

,

if(Quarter =$(vQtr) and Quarter=vNewMaxQtr, ($(vFCAMultiple)- $(vACTYOYServ))/$(vACTYOYServ),(($(vCurACTYOYServ)-$(vACTYOYServ)) / $(vACTYOYServ))) )

second if i not working   

vQtr = Quarter field  only

vNewMaxQutr = 2018Q3

pintucs20
Contributor III
Contributor III

Hi ,

can you share excel sheet of data.