Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Price index

Hello,

I would like to calculate the Price Index that depends products basket that was sold on chosen time interval.

Customer chooses the time interval that is used in following calculations:

Screenshot_2.jpg

The percents of Total appears:

Screenshot_3.jpg

Then according to the prices the Index is calculated:

Screenshot_4.jpg

I do only need the Total price index row. Every calculation should be made in front end.

I have attached the Example and the dummy data sample.

Thank you!

1 Solution

Accepted Solutions
sunny_talwar

This?

Sum(Aggr(

(Sum(TOTAL <Code>{<Date = {"$(='>=' & Date(varMinDate, 'YYYY.MM.DD') & '<=' & Date(varMaxDate, 'YYYY.MM.DD'))"}>}[Quantity, kg])/

Sum(TOTAL {<Date = {"$(='>=' & Date(varMinDate, 'YYYY.MM.DD') & '<=' & Date(varMaxDate, 'YYYY.MM.DD'))"}>}[Quantity, kg])) *

(sum([Sum, Eur])/sum([Quantity, kg])), Code, [Year, month]))


Capture.PNG

View solution in original post

12 Replies
sunny_talwar

Have you created a qvw already? I am feeling lazy to create one if it has been created already?

MindaugasBacius
Partner - Specialist III
Partner - Specialist III
Author

Everything I've tried failed.

This qvw is pure.

If you could just please pass me a concept or an idea. Something that I could grab on.

MindaugasBacius
Partner - Specialist III
Partner - Specialist III
Author

Any help on this matter would be much appreciated.

Thank you!

sunny_talwar

So I am here, I am not sure what all dimensions and expressions are needed for the output chart

Capture.PNG

Do I need to create a pivot table with Code and Year, Month field? or do you need one dimension?

MindaugasBacius
Partner - Specialist III
Partner - Specialist III
Author

The final result should be only one row:

Screenshot_1.jpg

One dimension for sure would be [Year, month] as this would appear as a chart.

sunny_talwar

This?

Sum(Aggr(

(Sum(TOTAL <Code>{<Date = {"$(='>=' & Date(varMinDate, 'YYYY.MM.DD') & '<=' & Date(varMaxDate, 'YYYY.MM.DD'))"}>}[Quantity, kg])/

Sum(TOTAL {<Date = {"$(='>=' & Date(varMinDate, 'YYYY.MM.DD') & '<=' & Date(varMaxDate, 'YYYY.MM.DD'))"}>}[Quantity, kg])) *

(sum([Sum, Eur])/sum([Quantity, kg])), Code, [Year, month]))


Capture.PNG

MindaugasBacius
Partner - Specialist III
Partner - Specialist III
Author

To clarify everything I do need the proportion made of the Quantity and period range that was set by user.

Then this proportion for different code should be as a constant value for the rest of the period.  We need to multiply proportion and the price from the different Year, month.

The end outcome is one row of data.

In case you're missing any information refer to me.

Thank you!

MindaugasBacius
Partner - Specialist III
Partner - Specialist III
Author

Seems promising!

I will check everything and get back.

sunny_talwar

Did my response above looks like what you wanted?