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: 
ryanfoster84
Creator
Creator

Summing the total positive values from a column

hi I am looking assistance with getting the sum of all the positive number from a column within a straight table in Qlikview but am running in trouble. I am attaching a spread sheet with the straight table in and you can reference it.

basically the table has 5 columns (A-E in the spread sheet) the issue I am having is that I want the sum of all the positive numbers of column e in the spread sheet (90.07).

I will then create a new column (column h) which divides column 6 / column 7 giving me the new column e.

I have tried numerous different things with no luck.

the formula that makes up column e (just for background info) is a follows

=IF($(vYoY_Chart) >0,($(vYoY_Chart))/($(vGrossPositiveVolumeYoY_Chart)),($(vYoY))/(FABS($(vGrossNegativeVolumeYoY_Chart))))

and the variables within this are broken out as follows:

=================================================================
vYoY_Chart
=================================================================
(Sum(
{$<
[Month] = ,
[Year] = {$(vMaxYear)}
>}
Volume))
-
(Sum(
{$<
[Month] = ,
[Year] = {$(vPreviousYear)}
>}
Volume))

=================================================================
vGrossPositiveVolumeYoY_Chart
=================================================================

=(SUM(Aggr(IF($(vYoY_Chart)>=0 AND [FO Indicator] = 'O',$(vYoY_Chart),0),[Product Line],[Product Description])))
+
(SUM(Aggr(IF($(vYoY_Chart)>=0 AND [FO Indicator] = 'F',$(vYoY_Chart),0),[Product Line],[Product Description])))

=================================================================
vGrossNegativeVolumeYoY_Chart
=================================================================

=(SUM(Aggr(IF($(vYoY_Chart)<0 AND [FO Indicator] = 'O',$(vYoY_Chart),0),[Product Line],[Product Description])))
+
(SUM(Aggr(IF($(vYoY_Chart)<0 AND [FO Indicator] = 'F',$(vYoY_Chart),0),[Product Line],[Product Description])))

1 Solution

Accepted Solutions
ryanfoster84
Creator
Creator
Author

I solved it

=sum(Total aggr(IF($(vYoY_Chart) >0,($(vYoY_Chart))/($(vGrossPositiveVolumeYoY_Chart)),0),[Description],[Name]))

View solution in original post

5 Replies
Anonymous
Not applicable

So is column e not calculating? Try

=IF($(vYoY_Chart) >0,($(vYoY_Chart),0)/($(vGrossPositiveVolumeYoY_Chart)),($(vYoY))/(FABS($(vGrossNegativeVolumeYoY_Chart))))


Or are your variables not calculating correctly?

ryanfoster84
Creator
Creator
Author

Column E is calculating but I am trying to get the total positive sum from column e in another column. so it should be 90.07

Anonymous
Not applicable

Maybe

=sum(TOTAL rangemax([Weighted % of Gain/Loss YoY],0))

Or am I missing something?

ryanfoster84
Creator
Creator
Author

hi no this does not work sadly. so just to make things easier I need to get the total positive volume for column e (90.07) in the spreadsheet. the formula that makes column is listed above.

ryanfoster84
Creator
Creator
Author

I solved it

=sum(Total aggr(IF($(vYoY_Chart) >0,($(vYoY_Chart))/($(vGrossPositiveVolumeYoY_Chart)),0),[Description],[Name]))