Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
ahbzshk07
Contributor III
Contributor III

Changing part of texts on dashboard with respect to loaded table

Is there any possible way of changing part of texts on dashboard with respect to mapped table or any table which have two columns viz. to-be-replaced-text field (FieldA here) and replacing-text field?

for e.g.:

on dashboard,

1) 'textA_Old' has to be replaced by 'textA_New'...

2) 'Qlikabc' to be replaced by 'Qlikpqr'


and my script has loaded a table which has values as

 

FieldAFieldB
OldNew
abcpqr

Regards.

6 Replies
settu_periasamy
Master III
Master III

Hi,

Can you give some more info / where do you want to replace text?

the below expression will give the result based on selection..

=Pick(WildMatch(FieldA,Concat(DISTINCT '*'&FieldA&'*',',')),Concat(DISTINCT FieldB,','))

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try MapSubString() in scirpting

mapsubstring('mapname', expr)

This function can be used for mapping parts of any expression on a previously loaded mapping table. The mapping is case sensitive and non-recursive. The substrings are mapped from the left to the right. Mapname is the name of a mapping table previously read by a mapping load or a mapping select statement (see Mapping). The name must be enclosed by single straight quotation marks. Expr is the expression whose result should be mapped by substrings.

Examples:

// Assume the following mapping table:

map1:

mapping load * inline [

x, y

1, <one>

aa, XYZ

x, b ] ;

MapSubstring ('map1', 'A123') returns 'A<one>23'

MapSubstring ('map1', 'baaar') returns 'bXYZar'

MapSubstring ('map1', 'xaa1') returns 'bXYZ<one>'

Hope this helps you.

ahbzshk07
Contributor III
Contributor III
Author

Hello! I will repeat the same info...

I want to replace the text on dashboard...

1) The text on dashboard now, (say in a text object) is 'defabc'

2) I load this table then:

 

FieldAFieldB
OldNew
abcpqr

3) The text should then change to 'defpqr'

Regards.

ahbzshk07
Contributor III
Contributor III
Author

hello!

Thanks for this...

I want to do this on dashboard, buddy...

Read my question again...

Regards.

jagan
Luminary Alumni
Luminary Alumni

Hi,

If you want to try in front end try like below using Replace(), but you need to write many nested If(), the best way to deal this is in script.

Regards,

Jagan.

ahbzshk07
Contributor III
Contributor III
Author

Yeah agree with the if scenario...


That's what I was wondering if there's any possible way by which we can use a field which will contain the replacing value... and then with a single reload, it will change the parts of texts on dashboard...

Now, I don't think that it is possible...

Anyways, thanks for your reply...