Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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

Re: expression in a textbox

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)

6 Replies
Not applicable

Re: expression in a textbox

Hi,

You could try this

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

Re: expression in a textbox

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)

MVP
MVP

Re: expression in a textbox

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')

Re: expression in a textbox

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.

Not applicable

Re: expression in a textbox

Perfect ! Thank you Mayil. It worked.

Not applicable

Re: expression in a textbox

Thanks. THis solution worked for me.

Community Browser