Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Custom percentage calculation

Hi All

In below (and attached QV) I need custom percentage, How this possible please?

Capture.PNG

Perc = (TotalValue / Mar-2012 (15627.62) )* 100

So for Jan-2012 -> (8891.78/15627.62) * 100 = 56.90% and so on

(Mar-2012 value is denominator always in this case)

I appreciate your help

Thanks

1 Solution

Accepted Solutions
Gysbert_Wassenaar

See attached qvw.


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar

See attached qvw.


talk is cheap, supply exceeds demand
simenkg
Specialist
Specialist

You can create a variable that that will calculate March-value and calculate with it.

create a variable vThisMonthValue as:

=Sum({<YearMonth={$(=Only({<Date={Today}>}YearMonth))}>}Value)

then your expression becomes:

Sum(Value)/$(vThisMonthValue)

if you only need to do this for the total column, then play around with:
Dimensionality() and SecondaryDimensionality() and use them in an if:

i.e:
if(Dimensionality()=0 and SecondaryDimensionality() = 1,

sum(Value)/$(vThisMonthValue)

,

sum(Value/SomeOtherValue

)

Anonymous
Not applicable
Author

Hi Gysbert

There is no attachment please.

Thanks

Anonymous
Not applicable
Author

Hi Simen

I appreciate your prompt reply. In my case(attached QV) has only one dimension, And 'Perc'  column is aggregated, I need effect in particular this column only.

Thanks for your time and effort