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

calculate % value

Hi all,

i have 8 fields in a table:

a - b - c - d - e - f - g - h

The values within these fields can be between 1 and 6. 6 = very Good. 1 = Very bad.

I have grouped the first 4 fields and the second 4 fields into 2 groups: a_to_d and e_to_h.

Within the LOAD script i did this like this:

LOAD

     a + b + c + d as a_to_e,

     e + f + g + h as e_to_h

...

What i want now is in a chart to calculate the % values for  a_to_d and e_to_h (e.g. over time).

My problem: How does the expression look like, if a value of 6 = Very Good = 100 % and a value of 1 = very bad = 0 % ?

Is it avg(a_to_e) / 6 ?

Hope, the description is clear...

Thanks in advance,

K

3 Replies
Anonymous
Not applicable
Author

it's not 100% clear what you want with the % ...

In what view do you want to see the % ...??

You say:

kalinkula wrote:

6 = very Good. 1 = Very bad.

...

6 = Very Good = 100 % and a value of 1 = very bad = 0 %

Is there only 1 of the a ... h filled?? So this can be translated into a percentage?

Or is every value possibly filled?? ... in this case you probably want to know the numbers choosen translated into a percentage?

rgrds

A

Not applicable
Author

Hi Anita,

thanks for the reply. Please consider the following table as an example:

UserIDabcdefgha_to_ee_to_h
11351652141512
22435156221315
331122141167

You see, every field is filled. The a_to_e and e_to_h are just the aggregates of the the first 4 and the latter 4 columns.

How would be the formula to calculate the % value of a_to_e ?

Regards,

K

Anonymous
Not applicable
Author

a percentage could be:  a_to_e /  (a_to_e + e_to_h)

but I assume you do want it somehow different?