Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to Calculate in chart

Hi all,

Can any one help me to do the below calulation in the chart. here i have to find the %Rate. this calculation i have to do in the chart itself

i have attached an excel having the sample data and calculation

Version NoYearMonthProd_VolUpg_VolCal
1.02010Jan10040
1.02010Feb11545
1.02010Mar12050
1.02010Apr12555
1.02010May13060
2.02010Jan1114141%
2.02010Feb1164640%
2.02010Mar1215143%
2.02010Apr1265645%
2.02010May1316147%
3.02010Jan11214267%
3.02010Feb11714764%
3.02010Mar12215263%
3.02010Apr12715763%
3.02010May13216262%
4.02010Jan11324375%
4.02010Feb11824871%
4.02010Mar12325370%
4.02010Apr12825868%
4.02010May13326367%

Calculation logic:

1. No need to calculateh the rate for the lowest version

2. to calculate the rate for version 2.0 use the below formula


Rate 2.0 jan = Upg_vol 2.0 Jan / Prod_Vol 1.0 Jan
Rate 2.0 Feb = Upg_vol 2.0 Feb / Prod_Vol 1.0 feb
Rate 2.0 mar = Upg_vol 2.0 mar / Prod_Vol 1.0 mar
Rate 2.0 Apr = Upg_vol 2.0 apr / Prod_Vol 1.0 apr
Rate 2.0 May = Upg_vol 2.0 may / Prod_Vol 1.0 may

3 to calculate the rate for version 3.0 use the below formula

Rate 3.0 jan = Upg_vol 3.0 Jan / (Prod_Vol 1.0 Jan + Prod_Vol 2.0 Jan)
Rate 3.0 Feb = Upg_vol 3.0 Feb / (Prod_Vol 1.0 feb + Prod_Vol 2.0 feb)
Rate 3.0 mar = Upg_vol 3.0 mar / (Prod_Vol 1.0 mar + Prod_Vol 2.0 mar)
Rate 3.0 Apr = Upg_vol 3.0 apr / (Prod_Vol 1.0 apr + Prod_Vol 2.0 apr)
Rate 3.0 May = Upg_vol 3.0 may / (Prod_Vol 1.0 may + Prod_Vol 2.0 may)

4 to calculate the rate for version 4.0 use the below formula

Rate 4.0 jan = Upg_vol 4.0 Jan / (Prod_Vol 1.0 Jan + Prod_Vol 2.0 Jan + Prod_Vol 3.0 Jan )
Rate 4.0 Feb = Upg_vol 4.0 Feb / (Prod_Vol 1.0 feb + Prod_Vol 2.0 feb + Prod_Vol 3.0 Feb)
Rate 4.0 mar = Upg_vol 4.0 mar / (Prod_Vol 1.0 mar + Prod_Vol 2.0 mar + Prod_Vol 3.0 Mar)
Rate 4.0 Apr = Upg_vol 4.0 apr / (Prod_Vol 1.0 apr + Prod_Vol 2.0 apr + Prod_Vol 3.0 Apr)
Rate 4.0 May = Upg_vol 4.0 may / (Prod_Vol 1.0 may + Prod_Vol 2.0 may + Prod_Vol 3.0 May)

Here version may be extended in furture so i cant give the version no in the chart

I hope you ll understand the above calculation. please suggest me how to calculate in chart

i have attached an excel for your reference.

5 Replies
lironbaram
Partner - Master III
Partner - Master III

hei

attach is an example

basically you'll need to load reference table which hold rows for for every version for every month for every year

this is not a great way , in term of performance but i don't see other way

give it a try

hope it helps you

Anonymous
Not applicable
Author

hi yes i tried this but its takes too much time to calculate the value, performace of the chart got reduced, can u suggest any other method for this

Anonymous
Not applicable
Author

hi,

Is any one having the solution for the above calculation. please suggest me an idea for this

maneshkhottcpl
Partner - Creator III
Partner - Creator III

Hi,

U can perform the calculation in backend script, it increases the reload time but improve the chart performance.

If u are unable to do, send me the application.

🙂

Smile

spsrk_84
Creator III
Creator III

Hi Manesh,

i got the solution in script level but only thing is you need to change the sort order in script .Go through the code and copy the code to your file and reload, perhaps both the Qvw and Excel file should exists in same folder.In UI Part u just the pivot chart to display values

In Pivot take all the Dimensions and in the expression just do Sum(Upd_Vol/NewProd value)

Copy the code from text file and test it with the excel data then apply the same logic to your actual data.

Hope if you follow in this way i don't think it will create any problems since the temp tables are dropped at the end.

Regards,

Ajay