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: 
Yuhka
Contributor III
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!

Labels (3)
2 Solutions

Accepted Solutions
saminea_ANZ
Creator
Creator

For me this sounds as Adhoc, Hence you can simply

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

 

View solution in original post

Vegar
MVP
MVP

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

View solution in original post

5 Replies
saminea_ANZ
Creator
Creator

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

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

Yuhka
Contributor III
Contributor III
Author

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
Creator
Creator

For me this sounds as Adhoc, Hence you can simply

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

 

Vegar
MVP
MVP

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
Yuhka
Contributor III
Contributor III
Author

@saminea_ANZ , @Vegar 

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