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

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How can i get this Frecuency...

Hello, I Would like to find the formula to obtain the relative frequency for a weight, for example:

I have one variable Chequeo with valors (1 or 2) and for each valor there is one Peso :

Valor Peso Chequeo

1 0.87 Calidad

1 0.999 Calidad

2 1.335 Servicios

2 0.85 Automóviles

and I would like to find:

(count(if ((Valor='1'),Chequeo))/count(Chequeo))*100

but I have to bear the weight in mind .

THANKS!!!!!!!!!

Labels (1)
7 Replies
Annette_Steinrücken
Former Employee
Former Employee

Hi,

What result do you expect for for example Calisas?

Regards, Annette

Not applicable
Author

For example: the frecuency from variable=Chequeo....of Calidad is 2/4 but, I want to obtain:

Count( Chequeo*Peso) / Count(Chequeo): is the same: (1*0.87)+(0.999*1)/4, if only where Valor=1

(count(if ((Valor='1'),Chequeo*Peso))/count(Chequeo))*100.......... it`s wrong!!!!!!!

Can you help me?..thanks........

Not applicable
Author

Can you try this

=if(valor='1',sum(Peso) / count(All Chequeo))*100

-Raghu

Not applicable
Author

Sorry, I want tis formula but with PESO:

(count(if ((Valor='1'),Chequeo))/count(Chequeo))*100



Annette_Steinrücken
Former Employee
Former Employee

Hi,

if you look at your example: (1*0.87)+(0.999*1)/4, you want to build a sum of PESO * frequency of Chequeo.
Does this mean that you will have the same Peso for more than one Chequeo?

Do you have an example where you might have (2*0.87)?

/Annette

Not applicable
Author

Yes, I have the same Peso for more than one Chequeo

I want to (the frequency) knows considered, that is to say the frequency when val=1 on val=2, bearing the weight in mind

Thanks.......Rose

johnw
Champion III
Champion III

Maybe this?

sum(if(Valor='1',Peso))/count(Chequeo)

As best I can tell, you don't need a count or Chequeo in the first part of the expression at all. You just want to sum up the Pesos where Valor = 1. If you have 0.87 Pesos twice, the sum() should count it twice (may depend on your exact data model). And I don't multiply by 100 because you can just display it as a percentage.