This field is required.
Only these extensions are allowed(.jpg, .JPG, .jpeg, .JPEG, .gif, .GIF, .png, .PNG)
Tags cannot contain the characters ' /, \\, #, ?, or ; >,< '
Only these extensions are allowed(.zip,.ZIP,.pdf,.PDF,.qvf,.QVF,.qvw,.QVW)
If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.
I have City table which contain only "CityName". I want to generate CityId with following condition:
I have more than 50 cities in the table. I want to fix "CityId" for some cities and rest should be autogenerated.
Please refer the below table, I want to fix values for cities A, B, C, D, E as 1, 2, 3, 4, 5 respectively. from CityName "F", it should autogenerate the values and should start from 6 and so on.
Is is possible to do with script??
Input - yellow values you have to entered as you said.
LOADCityName,CityId,CityId & if(len(CityId)='0',(RowNo()),'') as New_City_ID
if you dont want middle column
set \\ in front of CityId
View solution in original post
What do you mean when you say fixed for first 5 letters?
yes, you can do,
1. Autogenerate(RowNo(), CityName) as City Id,
if(CityName='A' and 'B' and 'C' and 'D' and 'E','',Autogenerate(RowNo(), CityName) as City Id,
Its not about first 5 letters.
I have some cities which I need to fix values for those.
For Ex: Value for Delhi should be 1 , Mumbai is 2 and Bangalore is 3 and rest all cities will be 4,5,6 and so on.
@Ksrinivasan Thanks Buddy
Its working 👍