Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
miro_kopecky
Contributor III
Contributor III

Chars in string differenciate

Hi, I need to write script in Qlik Sense and it should be something like this:
I have this table (picture) and I need to go through all of these words/strings/numbers and make column which will return True only if that value looks like this AXXXXXXX (A=capital letter, X=number) and False if it isn't like that format (AXXXXXXX).

Column "krajina" means country, column "pas" means the value I need to operate with and the column "typ" means the real status of that value so I can compare it with results.

Thanks for any help:)
Bez názvu.png 

Labels (1)
1 Solution

Accepted Solutions
Anil_Babu_Samineni

Are you still not got what you want? I am sorry, If i understand wrong way. BTW, What purpose you are doing? May be

If(IsNum(Left(Mid(číslo,2),1)), If(IsNum(Left(Mid(číslo,3),1)),
If(IsNum(Left(Mid(číslo,4),1)), If(IsNum(Left(Mid(číslo,5),1)),
If(IsNum(Left(Mid(číslo,6),1)), If(IsNum(Left(Mid(číslo,7),1)),
If(IsNum(Left(Mid(číslo,8),1)), 'True', 'False')))))))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

9 Replies
Anil_Babu_Samineni

Please provide sample data set and expected result?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
miro_kopecky
Contributor III
Contributor III
Author

The script should go through all values in column "pas" row by row...
If any row is value that has any capital letter on the first place and if it has any digit on the places 2 - 7, the output should be True...
In any other case the output should be False....
So the result will be same as column "Status"

I hope I explained it clear
Thanks:)

Anil_Babu_Samineni

Question understanding is simple, But implementation will take time for that we need sample data set to work? Does it make sense? I am happy, If you can't supply the data or Application.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
miro_kopecky
Contributor III
Contributor III
Author

If you meant my dataset, here it is:

 

Anil_Babu_Samineni

Thanks for that, Can you rephrase the question again. When ever you have value like AXXXXXX etc. If you can explain little more for me, That would be great.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
miro_kopecky
Contributor III
Contributor III
Author

The value must be like this format AXXXXXXX = 1. position - letter; 2.-8. position - digit
You have in column "číslo" for example these values:
JL651873 - this will make output "False" because on the second position is letter and it should be some digit
4B6812324 - this will make output "False" because on the first position is digit and should be letter
H7502472 - this is "True" because on the 1st position is letter and on the 2.-8. position is digit
SF9318747 -  this will make output "False" because on the second position is letter and it should be some digit

I hope you understand

Anil_Babu_Samineni

Thanks for your clarification, Perhaps try this? PFA

Capture.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
miro_kopecky
Contributor III
Contributor III
Author

Sorry, I did not mean I need to replace number with X but I need to check IF there is number on 2nd, 3rd, 4th, 5th, 6th, 7th and 8th position and if it is then True, else False.
Thank you.

Anil_Babu_Samineni

Are you still not got what you want? I am sorry, If i understand wrong way. BTW, What purpose you are doing? May be

If(IsNum(Left(Mid(číslo,2),1)), If(IsNum(Left(Mid(číslo,3),1)),
If(IsNum(Left(Mid(číslo,4),1)), If(IsNum(Left(Mid(číslo,5),1)),
If(IsNum(Left(Mid(číslo,6),1)), If(IsNum(Left(Mid(číslo,7),1)),
If(IsNum(Left(Mid(číslo,8),1)), 'True', 'False')))))))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful