Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Get variable name

Hi everyone !

I have in my Qlikview Ptrojet a population and in this population a number of good people. I wanna to knwo which variable and which selected modality increase the most the percentage of my good people in the all population. Every one is identified with an ID.

For exemple: if i have the variable : Hapiness with two modality 'high' 'low' so Hapiness= high or low

and a second variable Money= 'lot of' or 'few', the i would like to know which of the following percent is the highest :

          - Count( if [Person]='Good' and [Hapiness]='high', ID)) / Count (if ( [Hapiness]='high' , ID))

          - Count( if [Person]='Good' and [Hapiness]='low', ID)) / Count (if ( [Hapiness]='low' , ID))

          -Count( if [Person]='Good' and [Money]='lot of', ID)) / Count (if ( [Money]='lot of' , ID))

          - Count( if [Person]='Good' and [Money]='few', ID)) / Count (if ( [Money]='few' , ID))

I though about saving this percentage in varibales and use RangeMax(Var1,Var2,Var3,Var4) where Var1=HapineesHigh, Var2=HapinessLow ....but this fonction return just the percentage and not the name of the variable/modality, so i can't know which variable and which of its modality is the more discriminent.

How can i do ?

Please help me

Thank's

Am'

1 Solution

Accepted Solutions
Not applicable
Author

Try like below:

1. Dual('HappinessHigh', Count( if [Person]='Good' and [Hapiness]='high', ID)) / Count (if ( [Hapiness]='high' , ID)) )

2. Dual('HappinessLow', Count( if [Person]='Good' and [Hapiness]='low', ID)) / Count (if ( [Hapiness]='low' , ID)) )

3. Dual('MoneyLot', Count( if [Person]='Good' and [Money]='lot of', ID)) / Count (if ( [Money]='lot of' , ID)) )

4. Dual('MoneyFew', Count( if [Person]='Good' and [Money]='few', ID)) / Count (if ( [Money]='few' , ID)) )

Use RangeMaxString() function to get the respective variable name.

RangeMaxString( var1. var2, var3, var4 )

View solution in original post

2 Replies
Not applicable
Author

Try like below:

1. Dual('HappinessHigh', Count( if [Person]='Good' and [Hapiness]='high', ID)) / Count (if ( [Hapiness]='high' , ID)) )

2. Dual('HappinessLow', Count( if [Person]='Good' and [Hapiness]='low', ID)) / Count (if ( [Hapiness]='low' , ID)) )

3. Dual('MoneyLot', Count( if [Person]='Good' and [Money]='lot of', ID)) / Count (if ( [Money]='lot of' , ID)) )

4. Dual('MoneyFew', Count( if [Person]='Good' and [Money]='few', ID)) / Count (if ( [Money]='few' , ID)) )

Use RangeMaxString() function to get the respective variable name.

RangeMaxString( var1. var2, var3, var4 )

Not applicable
Author

Thank you very much !!!

Do you know how to get the second best % , the third one.. please ??