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: 
Not applicable

expression in a textbox

Hi,

I am trying to load text string in a textbox using an expression.Not sure why this is not working. If I try the same expression in a table chart it is working.Can anyone please help.My expression is = if(MeasureName='Occupancy',Narrative). Narrative is the field from where I am pulling text string.Columns in tha table are : MeasureName,Narrative,Entered By, Entered Month

Thanks Mridula

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Is MeasureName Field gets selected? Becuase in textbox if condition will work only if one MeasureName is selected

You could use

Only({<MeasureName={'Occupancy'}>} Narrative)

Or

MaxString({<MeasureName={'Occupancy'}>} Narrative)

Or

MinString({<MeasureName={'Occupancy'}>} Narrative)

View solution in original post

6 Replies
Not applicable
Author

Hi,

You could try this

if(only(MeasureName)='Occupancy',Narrative)

CELAMBARASAN
Partner - Champion
Partner - Champion

Is MeasureName Field gets selected? Becuase in textbox if condition will work only if one MeasureName is selected

You could use

Only({<MeasureName={'Occupancy'}>} Narrative)

Or

MaxString({<MeasureName={'Occupancy'}>} Narrative)

Or

MinString({<MeasureName={'Occupancy'}>} Narrative)

tresesco
MVP
MVP

This is because there would be many records, and in text box you are not using any aggregation function. Select one MeasureName and you would see something in the text if you put an expression like:

=if(MeasureName='Occupancy',Narrative, 'No Occupancy')

MayilVahanan

Hi

If you select the 'Occupancy' in MeasureName field, the number of possible values in Narrative field is only one, then its display that value in text object, otherwise it display '-' (Null).

Its work like only() function.

You can use like Concat(Distinct Narrative, ',') or MaxString(Narrative) like wise.
Or May be you can use Aggr() function also. Its depend on requirement.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Perfect ! Thank you Mayil. It worked.

Not applicable
Author

Thanks. THis solution worked for me.