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

Calculation issue for Selected Items

Hi All,

I have a requirement like, I have Sheet3, like below:

Now we need to capture No of Items falling under two red lines (1 in this example).

And total Items is 10.

We need to have Total Units for 1 Items / Total Units for 10 Items in sheet4.

I have some expression which is not working properly.

I am attaching test QVW file and expected result in excel with calculation.

Could anyone please help me on this.

1 Solution

Accepted Solutions
sunny_talwar

Try this

=Sum(Aggr(If(Sum(TOTAL <DIM_ITEM.ItemNumber> UnitsSold)*100/Sum(TOTAL <DIM_ITEM.ItemNumber> Aggr(Max(ForecastQuantity), CstFiscalPeriod, DIM_ITEM.ItemNumber)) >= $(v_Min)

and Sum(TOTAL <DIM_ITEM.ItemNumber>UnitsSold)*100/Sum(TOTAL <DIM_ITEM.ItemNumber> Aggr(Max(ForecastQuantity), CstFiscalPeriod, DIM_ITEM.ItemNumber)) <= $(v_Max), Sum(UnitsSold)), DIM_ITEM.ItemNumber, CstFiscalPeriod)) /

Sum(UnitsSold)


Capture.PNG

View solution in original post

6 Replies
avinashelite

can you explain the logic for this numbers i.e. 306 ,0 etc

 

CstFiscalYearCstFiscalPeriod[No name 1]
20181306
201820
2018324
2018412
2018512
2018612
201877
2018817
2018912
mhmmd_srf
Creator II
Creator II
Author

Hi Avinash,

This is sum(UnitsSolds) for  1 Item (Item No 721730) showing in Chart between two red lines with that specific selection.

Thanks,

Sarif

sunny_talwar

Also, can you explain how are you getting 626 here for Year 2018 and Period 1? What is Adjustable set at when you calculated the above number for units for items between red in the excel file?

Capture.PNG

sunny_talwar

Try this

=Sum(Aggr(If(Sum(TOTAL <DIM_ITEM.ItemNumber> UnitsSold)*100/Sum(TOTAL <DIM_ITEM.ItemNumber> Aggr(Max(ForecastQuantity), CstFiscalPeriod, DIM_ITEM.ItemNumber)) >= $(v_Min)

and Sum(TOTAL <DIM_ITEM.ItemNumber>UnitsSold)*100/Sum(TOTAL <DIM_ITEM.ItemNumber> Aggr(Max(ForecastQuantity), CstFiscalPeriod, DIM_ITEM.ItemNumber)) <= $(v_Max), Sum(UnitsSold)), DIM_ITEM.ItemNumber, CstFiscalPeriod)) /

Sum(UnitsSold)


Capture.PNG

mhmmd_srf
Creator II
Creator II
Author

Hi Sunny,

Are you using sum(UnitsSolds)? Or any other expression.

I am getting 626.

Thanks,

Sarif

sunny_talwar

Was using another expression ... but now I understand what you were looking for