Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Aggregation & Set analysis queries. Applying past performance to future.

Hi

I am trying to use detailed data of past performance and make projections for future.

This is my past sale trend. For a given state, district and product combination, there is the actual volume sold.

Past sale trend
StateDistrictProductVolume_sold
S1D1P1100
S1D1P2200
S1D2P2300
S2D3P3400

Now, at a macro level, I have the projection or target volume to be sold at a state level.

Plan for sale future
StateVolume_plan
S1700
S2500

I want to do these 2 tables below using pivot table.

Plan break up Districtwise and Productwise
StateDistrictVolume_plan
S1D1
S1D2
S2D3

StateDistrictProductVolume_plan
S1D1P1
S1D1P2
S1D2P2
S2D3P3

I am not clear about the use of TOTAL or other Set analysis functions.

Any help would be extremely useful.

Thanks in advance

ragha

1 Solution

Accepted Solutions
stephencredmond
Luminary Alumni
Luminary Alumni

Hi Ragha,

Volume_plan of S1 = Sum(TOTAL<State> Volume_plan)

Volume_sold of S1&D1 = Sum(TOTAL<State, District> Volume_sold)

Volume_Sold of S1 = Sum(TOTAL<State> Volume_sold)

So, the plan would be: Sum(TOTAL<State> Volume_plan) * Sum(TOTAL<State, District> Volume_sold) / Sum(TOTAL<State> Volume_sold)

Hopefully you should be able to work out the rest yourself?

Regards,

Stephen

Stephen Redmond is author of QlikView for Developer's Cookbook

He is CTO of CapricornVentis a QlikView Elite Partner. We are always looking for the right people to join our team.

Follow me on Twitter: @stephencredmond

View solution in original post

7 Replies
stephencredmond
Luminary Alumni
Luminary Alumni

Hi,

Something like this?

Regards,

Stephen

Stephen Redmond is author of QlikView for Developer's Cookbook

I am CTO of CapricornVentis a QlikView Elite Partner. We are always looking for the right people to join our team.

Follow me on Twitter: @stephencredmond

Not applicable
Author

Thanks Stephen for the response.

But that is not what I was looking for. Sorry for not being clear.

On the basis of past data, I want the projection to be split to the State, District and Product level.

In Excel,

     for the 1st table to be created, I would have used (Volume_plan of S1) * (Volume_sold of S1&D1 / Volume_Sold of S1) = Volume_plan of S1&D1

    

     for the 2nd table to be created, I would use the above formula to (Volume_plan of S1&D1)*(Volume_sold of S1&D1&P1)/Volume_sold of S1&D1)

I am not sure of how these excel SUMIF and CONCATENATE operations are to be done in qlikview.

Thanks again

ragha

stephencredmond
Luminary Alumni
Luminary Alumni

Hi Ragha,

Volume_plan of S1 = Sum(TOTAL<State> Volume_plan)

Volume_sold of S1&D1 = Sum(TOTAL<State, District> Volume_sold)

Volume_Sold of S1 = Sum(TOTAL<State> Volume_sold)

So, the plan would be: Sum(TOTAL<State> Volume_plan) * Sum(TOTAL<State, District> Volume_sold) / Sum(TOTAL<State> Volume_sold)

Hopefully you should be able to work out the rest yourself?

Regards,

Stephen

Stephen Redmond is author of QlikView for Developer's Cookbook

He is CTO of CapricornVentis a QlikView Elite Partner. We are always looking for the right people to join our team.

Follow me on Twitter: @stephencredmond

somenathroy
Creator III
Creator III

PFA .....

Though i hv doubt in your formula. pls check once again.

Regards,

Som

Not applicable
Author

Thanks for the response Somenath

Checked the logic. Its actually fine.

Attaching the final file just for the benefit of the community in case someone needs it.

Thanks again for the response.

ragha

Not applicable
Author

Hi Stephen

Thanks a lot.

But just before your response was received, I was going through the reference manual and found aggr().

I used Volume_sold of S1&D1 as     AGGR NODISTINCT SUM(Volume_plan, State, District)

On similar lines, remaining formulae also worked out

This seems to work fine too.

Could you please tell me which one is better to use?

Regards

ragha

stephencredmond
Luminary Alumni
Luminary Alumni

Hi,

I would always prefer to use Total, unless I need to have a different expression.

Regards,

Stephen