Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sarfaraz_sheikh
Contributor III
Contributor III

Row wise Sum after Multiplication.

Hello All,

I want to show the sum of rows after multiplication without aggregation . below is the example for clear level understanding.

I have below two columns [9LE Bulk] & [No of CR Pack On] which gets multiply and result will be your [Core Sold On premise] Column.


I am getting the expected result by using AGGR function but i do not want to use it as it is slowing down the performance while loading the chart at front end.  I cannot shift it to back end also because both  [9LE Bulk] & [No of CR Pack On] operating different dates columns on which user is making selection.


I want to do something in front end without aggregation and help would be much appreciated. 

[9LE Bulk] =

Count({<NumDateKey={">=$(=vFromDate9LEBulk)<=$(=vToDate)"},FLAG={2,3},

[Secondary Diff to Primary Flag]={0,1}>} Distinct [9LE Bulk])

[No of CR Pack On] =

Sum({<[BDE Visit Frequency]-={'000','NO CALL','VIRTUAL'},[Secondary Diff to Primary Flag]={0,1},

[Valid from]={"$(=vValidFrom)"},[Valid to]={"2958465"}>}[No of CR Bulk on])

[Core Sold On Premise]  = [9LE Bulk] * [No of CR Pack On]  -------------Without Aggregation


[Core Sold On Premise]  = Sum(Aggr([9LE Bulk] * [No of CR Pack On],Outlet,Product(IPL)))  -------------WithAggregation

Without Aggregation:

Sna2 with Aggregation.png

With Aggregation:

Snap 1(Without Aggregation).png

QVW is also attached here for your reference based on sample data not on real time data.

Thanks

Sarfaraz

10 Replies
sunny_talwar

Are you multiplying them or adding them? multiplying 1 with 0 gives 0, but you have 1 as the output?

Capture.PNG

sarfaraz_sheikh
Contributor III
Contributor III
Author

Hi Sunny ,

I am doing multiplication only .....you are viwing wrong column ....Please look at last column which is the actual result .

thanks

sarfaraz

sunny_talwar

I am still a little confused, but may be that is because you mentioned that the output was in Core Range on Premise... anyways... coming back the issue... the only thing which you need Sum(Aggr(...)) for is to get the totals right... otherwise everything else is working? Why don't you use Sum of Rows for total mode as you seem to be using a straight table here?

Capture.PNG

sarfaraz_sheikh
Contributor III
Contributor III
Author

Thanks Sunny for your reply.

If you remove Product (IPL) from dimension then you will get 7 only even if you select Total Mode as sum of rows.

And I am using Qliksense. Can't we do something in such manner that will get 4 without Aggregation.

Thanks

Sarfaraz

sunny_talwar

I don't think it would be possible to do this without the aggregation

sarfaraz_sheikh
Contributor III
Contributor III
Author

Data is huge ......and its taking time to much to load.

Anyway let me try from my end. 

gwassenaar‌ ; hic‌ ; jagan‌  Please comment

Thanks

sunny_talwar

Sure

sarfaraz_sheikh
Contributor III
Contributor III
Author

Can anybody please help me on this ?? Its on high priority and got stuck here.

hic‌ ; jagan‌  please comment

Thanks

Sarfaraz

Anil_Babu_Samineni

Is there any specific reason to avoid Aggregation over measure?

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