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

How to search a string in a Field with a dynamic variable?

Hi,

I have an expression witch find how many times the string appear in a Field :  = count( DISTINCT {Field="DER.5"}   Field )

Now i want to improve the expression with a dynamic variable!

Indeed,

I have another field : Month (jan, feb,...)

and I want when I clik on the January The string to find is "DER.1"   and February the string become : "DER.2", for March "DER.3"  etc...

Do you an idea?

Thanks.

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hi,

Try with something like

Count({< Field = {"DER.$(=MixMatch(Month, 'janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'))"} >} Field)

Hope that helps.

Miguel

View solution in original post

5 Replies
Not applicable
Author

I have this expression to convert the Field to a number:

    mixmatch(Month,  'janv.' , 'févr.' , 'mars' , 'avr.' , 'mai' , 'juin' , 'juil.' ,'août' , 'sept.' ,'oct.' , 'nov.' , 'déc.' )

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Check with this

     = count( DISTINCT {Field="DER.$(mixmatch(Month,  'janv.' , 'févr.' , 'mars' , 'avr.' , 'mai' , 'juin' , 'juil.' ,'août' , 'sept.' ,'oct.' , 'nov.' , 'déc.' ))"}   Field )

     Or

    

= count( DISTINCT {Field={'DER.$(mixmatch(Month,  'janv.' , 'févr.' , 'mars' , 'avr.' , 'mai' , 'juin' , 'juil.' ,'août' , 'sept.' ,'oct.' , 'nov.' , 'déc.' ))'}}   Field )


Not applicable
Author

Thanks for your answer,

But it seems that it does not work.

Another solution?

Miguel_Angel_Baeyens

Hi,

Try with something like

Count({< Field = {"DER.$(=MixMatch(Month, 'janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'))"} >} Field)

Hope that helps.

Miguel

Not applicable
Author

Thank you Miguel,

This is perfect!