Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
clovati
Partner - Creator
Partner - Creator

Formula setting variable

Dear all....

I have a variable:

eGMS = Pick(Match(GetCurrentField([MM-WK-GG]), 'DataVend', 'MMM', 'WK'), 'G', 'M', 'S')

In some cases, there is a button that put eGMS = 'G'.

With a trigger when I leave the sheet (where there is the button) I am trying to give the variable the formula variable but I'm not able :-(.

I tried also with a 2nd variable i.e.:

* eGMS_Formula = Pick(Match(GetCurrentField([MM-WK-GG]), 'DataVend', 'MMM', 'WK'), 'G', 'M', 'S')

* trigger : eGMS = $(eGMS_Formula)

* trigger : eGMS = '$(eGMS_Formula)'

but I've not the possoibility to make variable as expression/ formula.

THANKS a lot!

CriL

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Peter, I don't understand the need for escaping all the quotes. Since the expression string is not dynamic, can't it just be entered in the Action Value directly as:

Pick(Match(GetCurrentField([MM-WK-GG]), 'DataVend', 'MMM', 'WK'), 'G', 'M', 'S')

-Rob

View solution in original post

12 Replies
Mark_Little
Luminary
Luminary

Hi,

What is it exactly you are wanting to happen here?

On leaving the sheet what are you try to get into a variable?

Is this the actual string value 'Pick(Match(GetCurrentField([MM-WK-GG]), 'DataVend', 'MMM', 'WK'), 'G', 'M', 'S')'?

Mark

clovati
Partner - Creator
Partner - Creator
Author

Hi Mark! Thanks first af all.

Yes, I want eGMS will still be 'Pick...' as when I open QWV ex-novo.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

In the action expression field, enter this:

='= Pick(Match(GetCurrentField([MM-WK-GG]), ' & chr(39) & 'DataVend' & chr(39) & ', ' & chr(39) & 'MMM' & chr(39) & ', ' & chr(39) & 'WK' & chr(39) & '), ' & chr(39) & 'G' & chr(39) & ', ' & chr(39) & 'M' & chr(39) & ', ' & chr(39) & 'S' & chr(39) & ')'

I may have accidentally omitted a single quote. Check the number of quotes if it doesn't result in eGMS containing the correct formula.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Enter the trigger value expression without $(). You don't want it evaluated, you want the literal string.

trigger : eGMS = eGMS_Formula


-Rob

http://masterssummit.com

http://qlikviewcookbook.com


Mark_Little
Luminary
Luminary

Hi,

Just like Rob has mentioned. Just enter the string like

Pick(Match(GetCurrentField([MM-WK-GG]), 'DataVend', 'MMM', 'WK'), 'G', 'M', 'S')


Mark

clovati
Partner - Creator
Partner - Creator
Author

That's ok! Thanks a lot!

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Peter, I don't understand the need for escaping all the quotes. Since the expression string is not dynamic, can't it just be entered in the Action Value directly as:

Pick(Match(GetCurrentField([MM-WK-GG]), 'DataVend', 'MMM', 'WK'), 'G', 'M', 'S')

-Rob

clovati
Partner - Creator
Partner - Creator
Author

I want to mark as RIGHT ANSWER.. but where?

Da: Rob Wunderlich

Inviato: mercoledì 18 novembre 2015 15:53

A: Lovati Cristina

Oggetto: Qlik Community: New reply - Formula setting variable

oknotsen
Master III
Master III

How about clicking "Correct Answer" near the post that is the correct answer?

May you live in interesting times!