Skip to main content

Hi Team,

 

I'm trying to build a KPI shows which column data has wrong fields.

I'm using the KPI syntax as below but it is not working. Could you please help me on this case.

CASE WHEN LEN ("TableA_xlsx_TableA"."Name") > 4 OR ("TableA_xlsx_TableA"."Name") IN_LIKE ('!','@','#','$','^','*','(',')','-','_','+','=','{','}','9',']','|','/',':',';','"','<','>',',','.','?','9%]') THEN 'Name, ' ELSE '' END ||

CASE WHEN ("TableA_xlsx_TableA"."Country") IN_LIKE ('!','@','#','$','^','*','(',')','-','_','+','=','{','}','9',']','|','/',':',';','"','<','>',',','.','?','9%]') THEN 'Country, ' ELSE '' END ||

CASE WHEN ("TableA_xlsx_TableA"."SubID") IN_LIKE ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9') THEN 'SubID' ELSE '' END

 

KPI

Hi Gundappa,

 

I've tested your code and should work:

image.pngI've only changed the Table names when transforming the file upload.

 

In the next picture you can see the results

analysisThis analysis shows an OLAP TABLE with a custom KPI with the PQL code you provided and it works!!

 

Sorry to don´t find a bug,

 

Javier

 

 

 

 


Hello Javier,

 

Thank you for the answer. Could you please help with handling the null values, if there are any null values in any of the column then the code is not working for that row.KPI2 

Code is:

CASE WHEN LEN ("NEW_xlsx_Sheet1"."NAME") > 4 OR ("NEW_xlsx_Sheet1"."NAME") IN_LIKE ('!','@','#','$','^','*','(',')','-','_','+','=','{','}','9',']','|','/',':',';','"','<','>',',','.','?','9%]') THEN 'Name, ' ELSE '' END ||

CASE WHEN ("NEW_xlsx_Sheet1"."COUNTRY") IN_LIKE ('!','@','#','$','^','*','(',')','-','_','+','=','{','}','9',']','|','/',':',';','"','<','>',',','.','?','9%]') OR LEN ("NEW_xlsx_Sheet1"."COUNTRY" ) > 4 THEN 'Country, ' ELSE '' END ||

CASE WHEN ("NEW_xlsx_Sheet1"."SUBID") IN_LIKE ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9') THEN 'SubID' ELSE '' END

 

Output is as below

 

KPI2Thanks in advance for your help!

 

Gundappa

 

 

 

 


👍


Hi Gundappa

 

I think with an additional check wheter is null the column would make the deal, for instance for the first part of the query I owuld try:

CASE WHEN

(ISNULL("TableA_xlsx_TableA"."Name") = 0)

AND 

(LEN ("TableA_xlsx_TableA"."Name") > 4

OR ("TableA_xlsx_TableA"."Name")  IN_LIKE ('!','@','#','$','^','*','(',')','-','_','+','=','{','}','3',']','|','/',':',';','"','<','>',',','.','?','3%]'))

 

 

Hope it helps

Javier


Hi Gundappa

 

I think with an additional check wheter is null the column would make the deal, for instance for the first part of the query I owuld try:

CASE WHEN

(ISNULL("TableA_xlsx_TableA"."Name") = 0)

AND 

(LEN ("TableA_xlsx_TableA"."Name") > 4

OR ("TableA_xlsx_TableA"."Name")  IN_LIKE ('!','@','#','$','^','*','(',')','-','_','+','=','{','}','3',']','|','/',':',';','"','<','>',',','.','?','3%]'))

 

 

Hope it helps

Javier

THANKS TON Javier. Now I'm able to handle the null values 😊


👏 Glad to help

Regards


Reply