Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
datanibbler
Champion
Champion

Something with my variables doesn't work - why?

Hi,

I have learnt here in the Community that I can define a variable in the script so that it is filled with a value on the GUI, basically using two equal_signs and the 'SET' command.

Usually that works fine. For some reason, however, it doesn't work in an app I am currently working on.

Maybe one of you can imagine why that is or where the error is.

In the app I'm working on, there is a rather large straight_table_chart. To make it clearer, I want to give the user a possibility of selecting which fields he/she wants to see.

Now, in my app, I have a field >> __fields_to_display << from an Inline_table. That has a Hide_Prefix so it doesn't show up in a statusbox which would be quite confusing as this is not a selection supposed to limit the amount of data.
<=> What this actually does (or is supposed to do) is that for every field in this Inline_table, there is a variable. That is supposed to query the presence of this field in the output of a Getfieldselections() command and if any field is present, the corresponding variable should take on the value 1, otherwise it should be -1.

The code in the script is like this:

>> SET v_show_calculation = = IF(INDEX(Getfieldselections(__Detailfelder), 'Berechnung') > 0, 1, -1) <<

It seems not to work - at least, not reliably, not always.

I'll try out if it might be because of the Hide_Prefix. Though I have tried out that Index() function and it works reliably on the GUI.

Thanks for any ideas!

Best regards,

DataNibbler

10 Replies
datanibbler
Champion
Champion
Author

Finally!

That was it. Logically - when the output of that function changes, none of the words can be found anymore and the variables do just what they are actually supposed to do, they all change.

Thanks a lot anyway!