Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
lsdrolias
Contributor II
Contributor II

Only() expression does not work

Hi all,

In a chart I have the expression

trim(Mid(RoleName,index(RoleName,chr(32),-1)+1))

that returns the correct result (e.g. PER). I want to use this result in only() function to return the result PERSONEL

=Only({$ <APPLICATION_NAME=,APPLICATION_SHORT_NAME={"=$(=trim(Mid(RoleName,index(RoleName,chr(32),-1)+1)))"}>} APPLICATION_NAME)

I have tried different variations but they all retun --

Can you please help?

4 Replies
sunny_talwar

Try this without the = sign after the dollar sign:

=Only({$ <APPLICATION_NAME=,APPLICATION_SHORT_NAME={"$(=Trim(Mid(RoleName, Index(RoleName, Chr(32), -1) +1)))"}>} APPLICATION_NAME)

Update: The idea is you want to do this -> APPLICATION_SHORT_NAME = {"PER"} and not APPLICATION_SHORT_NAME = {"=PER"}

Kushal_Chawda

try this,

Only({$ <APPLICATION_NAME=,APPLICATION_SHORT_NAME={"=trim(Mid(RoleName,index(RoleName,chr(32),-1)+1))"}>} APPLICATION_NAME)

lsdrolias
Contributor II
Contributor II
Author

Thank you all for your suggestions that I am sure would make the expression work. However I discovered that the main reason the expression could not work is that the field RoleName included in the set filter is a dimension that is not recalculated within the chart. Therefore I found a workaround inside the script. Thanks any way.

sunny_talwar

Works for us. As long as you are able to resolve your issue, we are happy