Forum Discussion

jak8282's avatar
jak8282
Icon for Helper III rankHelper III
3 years ago
Solved

Replicating Qlikview function in Power

Hi,

 

I have the following in Qlikview

 

// Test records:

if(wildmatch(lower(FIRST_NAME),'*dummy*','*regression*',' test*','test *','*condition*','*invalid*')>0 or wildmatch(lower(LAST_NAME),'*dummy*','*regression*',' test*','test *','*condition*','*invalid*')>0
or wildmatch(lower(ADDRESS1),'*dummy*','*regression*','*condition*','*invalid*')>0 or wildmatch(lower(EMAIL_ADDRESS),'*dummy*','*regression*',' test*','test *','*condition*','*invalid*')>0
or wildmatch(lower(CITY),'*dummy*','*regression*',' test*','test *','*condition*','*invalid*')>0
,'Test Records','Clients') as Status,

 

How would I go about replicating that in Powerbi, does a conditional column accept wildcards?

 

Thanks

 

C

  • In place of wildcard try to use FIND(), SEARCH(), CONTAINSSTRING(), CONTAINSSTRINGEXACT().
    The Qlik function needs to be rewritten.

     

3 Replies

  • Hi jak8282 ,

    Based on your description, I'd like to suggest you use FIND(), SEARCH(), CONTAINSSTRING(), CONTAINSSTRINGEXACT().

     

    Here is the functions for text.

    1. Text connection functions :  

     

    CONCATENATE(<text1>, <text2>)
    CONCATENATEX(<table>, <expression>, [delimiter])
    COMBINEVALUES(<delimiter>, <expression>, <expression>[, <expression>]…)
    DISTINCT(SELECTCOLUMNS(DimDate, "Month", COMBINEVALUES(",", [MonthName], [CalendarYear])))

     

    2. Text search functions : 

     

    FIND(<find_text>, <within_text>[, [<start_num>][, <NotFoundValue>]])  
    SEARCH(<find_text>, <within_text>[, [<start_num>][, <NotFoundValue>]]) 
    CONTAINSSTRING(<within_text>, <find_text>) 
    CONTAINSSTRINGEXACT(<within_text>, <find_text>)

     

    3. Formatting text functions : 

     

    FIXED(<number>, <decimals>, <no_commas>)  
    FORMAT(<value>, <format_string>)

     

    4. Intercepting text functions : 

     

    LEFT(<text>, <num_chars>)
    RIGHT(<text>, <num_chars>)  
    MID(<text>, <start_num>, <num_chars>) 

     

    5. Replace text : 

     

    REPLACE(<old_text>, <start_num>, <num_chars>, <new_text>)  
    SUBSTITUTE(<text>, <old_text>, <new_text>, <instance_num>) 

    Thanks ,
    Pratyasha Samal
    Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
    If you found this post helpful, please give Kudos C

    • jak8282's avatar
      jak8282
      Icon for Helper III rankHelper III

      Thanks Pratuashamal , can you use wildcards in those functions?

      • pratyashasamal's avatar
        pratyashasamal
        Icon for Memorable Member rankMemorable Member

        In place of wildcard try to use FIND(), SEARCH(), CONTAINSSTRING(), CONTAINSSTRINGEXACT().
        The Qlik function needs to be rewritten.