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: 
kkkumar82
Specialist III
Specialist III

Aggregation issue

All,

I am facing an issue between Text box and Straight table in QlikView.

I have a Dimension ProjectID and three expressions as below , and what the data is showing is as

Expression1 value = Expression2 * Expression3

but I am trying to the same in  a text object because of not having dimension the aggregation is behaving differently and summing up

the final value. please see below data.

ProjectIDSavingsPriceQuantity
Total5608211.582629.262133
11324823002575964
11316208.9718.03899
1149782.136.23270

The problem when I write "Savings" expression in a text object is I am getting - 5608211.58 which is incorrect as it is calculating

2629.26 * 2133.

The correct value for savings is 2482300+16208.97 + 9782.1 = 2508291.07

The formula used for Savings is below , in that first part is Price , second part is Quantity.

=Sum({<rcv_Flag ={1}, VIP_PROJECT_STATUS={'Complete'},[pol.CANCEL_FLAG]={'N'},[VIP_NEW_ITEM_DETAIL.VIP_NEW_ITEM]={'No'} >}

distinct [VIP_NEW_ITEM_DETAIL.VIP_ITEM_BASELINE_COST] -pol_UNIT_PRICE)

*

Sum({<rcv_Flag={1}, VIP_PROJECT_STATUS={'Complete'},[pol.CANCEL_FLAG]={'N'},[VIP_NEW_ITEM_DETAIL.VIP_NEW_ITEM]={'No'} >}

Aggr(rcv_QUANTITY_Test,rcv_TRANSACTION_DATE,rcv_TRANSACTION_ID))

Any suggestion will be greatful.

1 Solution

Accepted Solutions
sunny_talwar

This should do it

Sum(Aggr(

Sum({<rcv_Flag ={1}, VIP_PROJECT_STATUS={'Complete'},[pol.CANCEL_FLAG]={'N'},[VIP_NEW_ITEM_DETAIL.VIP_NEW_ITEM]={'No'} >}

distinct [VIP_NEW_ITEM_DETAIL.VIP_ITEM_BASELINE_COST] -pol_UNIT_PRICE)

*

Sum({<rcv_Flag={1}, VIP_PROJECT_STATUS={'Complete'},[pol.CANCEL_FLAG]={'N'},[VIP_NEW_ITEM_DETAIL.VIP_NEW_ITEM]={'No'} >}

Aggr(rcv_QUANTITY_Test,rcv_TRANSACTION_DATE,rcv_TRANSACTION_ID))

, ProjectID))

View solution in original post

3 Replies
sunny_talwar

This should do it

Sum(Aggr(

Sum({<rcv_Flag ={1}, VIP_PROJECT_STATUS={'Complete'},[pol.CANCEL_FLAG]={'N'},[VIP_NEW_ITEM_DETAIL.VIP_NEW_ITEM]={'No'} >}

distinct [VIP_NEW_ITEM_DETAIL.VIP_ITEM_BASELINE_COST] -pol_UNIT_PRICE)

*

Sum({<rcv_Flag={1}, VIP_PROJECT_STATUS={'Complete'},[pol.CANCEL_FLAG]={'N'},[VIP_NEW_ITEM_DETAIL.VIP_NEW_ITEM]={'No'} >}

Aggr(rcv_QUANTITY_Test,rcv_TRANSACTION_DATE,rcv_TRANSACTION_ID))

, ProjectID))

kkkumar82
Specialist III
Specialist III
Author

Let me give a try

kkkumar82
Specialist III
Specialist III
Author

Thanks alot of sunny