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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Ja123__
Partner - Creator
Partner - Creator

Set analysis gives correct figure in table. But when I add to a KPI I get zero?

Hi Guys

When I have my calculation in a table the row value is correct but the value for the total reflects 0, as well as when I add it to my KPI?

Am I missing something??

Capture2.PNG

HIGHLIGHTED CALCULATION

 

Sum(
{
<txtDescription12INDICATOR = {'AVC'}, dteEffectiveDate11 = {[<=$(vEndDate)]}, blnRepeat = {'1'},dteTerminated11INDICATOR = {'-1'}, ExitTypeINDICATOR = {'-1'}>
+
<txtDescription12INDICATOR = {'AVC'}, dteEffectiveDate11 = {[<=$(vEndDate)]}, blnRepeat = {'1'},dteTerminated11 = {[>$(vEndDate)]}, ExitTypeINDICATOR = {'-1'}>
}

if(isnull(numAmount),0,numAmount)

)

*       

//Times by the number of months. Also if there is a shorter period between effective date and end date rather use that //than the overall DateDiff variable which just does the month differences between the two dates.

 

if(


min(
{
<txtDescription12INDICATOR = {'AVC'}, dteEffectiveDate11 = {[<=$(vEndDate)]}, blnRepeat = {'1'},dteTerminated11INDICATOR = {'-1'}, ExitTypeINDICATOR = {'-1'}>
+
<txtDescription12INDICATOR = {'AVC'}, dteEffectiveDate11 = {[<=$(vEndDate)]}, blnRepeat = {'1'},dteTerminated11 = {[>$(vEndDate)]}, ExitTypeINDICATOR = {'-1'}>
}

round((Date(Date#('$(vEndDate)','YYYY/MM/DD')) - Date(Date#(dteEffectiveDate11, 'YYYY/MM/DD'))) / 30.42))
<
$(vMonthDiff)
,
min(
{
<txtDescription12INDICATOR = {'AVC'}, dteEffectiveDate11 = {[<=$(vEndDate)]}, blnRepeat = {'1'},dteTerminated11INDICATOR = {'-1'}, ExitTypeINDICATOR = {'-1'}>
+
<txtDescription12INDICATOR = {'AVC'}, dteEffectiveDate11 = {[<=$(vEndDate)]}, blnRepeat = {'1'},dteTerminated11 = {[>$(vEndDate)]}, ExitTypeINDICATOR = {'-1'}>
}
round((Date(Date#('$(vEndDate)','YYYY/MM/DD')) - Date(Date#(dteEffectiveDate11, 'YYYY/MM/DD'))) / 30.42))
,
$(vMonthDiff)
)

 

 

 

vMonthDiff

=
round(
(Date(Date#('$(vEndDate)','YYYY/MM/DD')) - Date(Date#('$(vStartDate)','YYYY/MM/DD'))) / 30.42
)

 

 

I know the formula can be confusing but clearly I am missing why my totals are gone.

 

Labels (3)
1 Solution

Accepted Solutions
sunny_talwar

Try adding Sum(Aggr(YourExpression, ChartDimensions)) to get the correct total.

View solution in original post

2 Replies
sunny_talwar

Try adding Sum(Aggr(YourExpression, ChartDimensions)) to get the correct total.

Ja123__
Partner - Creator
Partner - Creator
Author

Thanks Sunny!
Sum(Aggr(
COPY AND PASTE ABOVE SCRIPT
, MemberID , txtClientName , txtFirstname ,txtSurname ))

Did the job