Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Yuhka
New Contributor III

About the expression GetFieldSelections

 

Hello guys, I'm new to qlikview.

On my straight table chart, I would like to show only the items which selected as an output item.

(Selected in the listbox -> Reflected to the Straight table)

I used "GetField Selections" expression for the dimentions of straight table, but it doesn't work properly.

As the following screenshot, when I select an item "Unit Cost", an item "Cost" also displayed in the straight table due to t a part of item name is same.

*Enable Consitional:

=GetFieldSelections([Output items],',',110)like '*Cost*'

=GetFieldSelections([Output items],',',110)like '*Unit Cost*'

キャプチャ.PNG

 

Is it possible to distinguish between "Cost" and "Unit Cost"?

Thank you for your support!

2 Solutions

Accepted Solutions
saminea_ANZ
New Contributor III

Re: About the expression GetFieldSelections

For me this sounds as Adhoc, Hence you can simply

=SubStringCount('|' & Concat(distinct [Output Items], '|') & '|', '|Cost|')

 

Vegar
Honored Contributor

Re: About the expression GetFieldSelections

I have not used you approach my self, but is it not possible to do like this?

=GetFieldSelections([Output items],',',110) = 'Cost'

If it is not then the solution below should give you your desired result.

SubStringCount( Concat( DISTINCT '|' & [Output items] & '|'), '|Cost|')
AND
GetSelectedCount ([Output items]) > 0
Please ekskuse my Norglish and Swenglish typos.
5 Replies
saminea_ANZ
New Contributor III

Re: About the expression GetFieldSelections

Not really sure - What you tried and trying here? Perhaps this

If([Output items]='Cost', 1,0)

Yuhka
New Contributor III

Re: About the expression GetFieldSelections

Hello @saminea_ANZ !

Thank you for your suppot!

I would like to select multiple items as the output items... so I cannot use expression "=".

saminea_ANZ
New Contributor III

Re: About the expression GetFieldSelections

For me this sounds as Adhoc, Hence you can simply

=SubStringCount('|' & Concat(distinct [Output Items], '|') & '|', '|Cost|')

 

Vegar
Honored Contributor

Re: About the expression GetFieldSelections

I have not used you approach my self, but is it not possible to do like this?

=GetFieldSelections([Output items],',',110) = 'Cost'

If it is not then the solution below should give you your desired result.

SubStringCount( Concat( DISTINCT '|' & [Output items] & '|'), '|Cost|')
AND
GetSelectedCount ([Output items]) > 0
Please ekskuse my Norglish and Swenglish typos.
Yuhka
New Contributor III

Re: About the expression GetFieldSelections

@saminea_ANZ , @Vegar 

It went well! Thank you for your perfect answer!!!