Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
qliksus
Specialist II
Specialist II

regarding lenth function in set analysis

Hi,

I want to write a set analysis expression based on length of field . I have fields Year,Period,Number and Amount. Now Number contains Blank values also which is not a null value but lenght is 6. So i want the Total Amount without the blank value. So i have written the expression like,

sum({ <Year={$(#=max(@_Year))}>} Amount) -sum({ <Year={$(#=max(@_Year))},len(Number)={6}>} Amount)

But it is giving error in expression at len(Number) function.



Ans also i have 1-12 period for which i have to calculate current year and current period. Here no date field is there. How can i calulate the latest year and latest period??????

I am using max(Year) and it gives the correct answer but unfortunately max(Period) is giving the 12 number period of previous year. Can anyone help me????????



1 Solution

Accepted Solutions
Anonymous
Not applicable

I don't think you can use anything other than field names on the left side of the = signs when defining your set analysis sets.

Len(Number) is in other words not allowed but you should be able to calculate this on the script side: Len(Number) as Len_Number and use this field in defining your set. I didn't look through the other stuff so I'm not sure if there was anything else to take into consideration.

View solution in original post

2 Replies
qliksus
Specialist II
Specialist II
Author

Also i want rename the Blank value as Others in Number field. Can anyone help me?????

Anonymous
Not applicable

I don't think you can use anything other than field names on the left side of the = signs when defining your set analysis sets.

Len(Number) is in other words not allowed but you should be able to calculate this on the script side: Len(Number) as Len_Number and use this field in defining your set. I didn't look through the other stuff so I'm not sure if there was anything else to take into consideration.