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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Find value in the column and derive the result

I have a table , which contains the following data.

tcodeLicenseTypeID
CJ20N1
CJ20N2
ME2N1
ME2N2
ME23N1
ME23N2
ME51N1
ME51N2

I want an expresssion, which will lookup for each unique tcode , if the licensetypeid '2' is available for that tocde and return text "All available in type 2'

8 Replies
tresesco
MVP
MVP

try :

Concat ( Distinct (LicenseTypeID) , ' ; ')

Not applicable
Author

Hi Tres

The above code always gives 1;2

tresesco
MVP
MVP

My mistake, try:

Concat ( Distinct (tcode) , ' ; ')

Not applicable
Author

Thanks Tres

Your code gives me the unique tcodes, what i want is to find if all the tcodes available in the col A has licensetypeid='2' or not?

tresesco
MVP
MVP

this ?

=If(count(DISTINCT(tcode))= count(distinct {<LicenseTypeID={2}>} DISTINCT tcode), 'All available in type 2'', 'NO')

Not applicable
Author

Thanks Tres , I did more or less the same and it worked

= if((count( DISTINCT tcode))= ( Count( DISTINCT if( LicenseTypeID='2' or IsNull( LicenseTypeID ),tcode))),'LP','P')

Thanks

Not applicable
Author

Hi Tres

How would i achieve this through scripting? lets say my data is

UseridtcodeLicenseTypeID
abcCJ20N1
abcCJ20N2
abcME2N1
abcME2N2
xyzME23N1
xyzME23N2
xyzME51N1
xyzME51N2
xyzSU011

The result should check each tcode for each user, and if the tcodes for individual user lies in License type id='2' , it should suggest "Userid is of licensetypeid 2" and if the user's any one tcode does not have licensetypeid 2, it should suggest "Userid is of licensetypeid 1"

UserIDSuggestion
abc2
xyz1

Kind Regards

daveamz
Partner - Creator III
Partner - Creator III

Hi,

I don't think this is the best approach but see the file attached.

Best regards,

David