Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
pauldamen
Partner - Creator II
Partner - Creator II

Create a listbox with several variables

Dear all,

I want to create a listbox containing different variables I made which you can select.

So I have 5 variables created (5 formulas) which I  want to put in a listbox so that users can select 1 which is then put into a graph.

How can I put the 5 variables in 1 listbox? I can't make a group because it is nog cyclic or drill down, I want to display the five variables just in a row.

How someone can help me!

Kind regards,

Paul

24 Replies
pauldamen
Partner - Creator II
Partner - Creator II
Author

Yes also tried the single quotes, it always only wants to load the only the first part of the formula.

I have attached the file. I have now tried to put the variables under the second tab "bronnen" and the inline load is in the last tab "analyse"

Hope you can help

Not applicable

try this when you set your variables:

set vTienermoeders = "sum([Aantal tienermoeders])/sum({<Geslacht = {'Vrouwen'}>}[Vrouwen onder 18 jaar])";

regards,

MT

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

There are some undocumented features for inline loads. Here is an example that could work for you:

LOAD Key,

          Replace(Value, '#', '$') As Value

Inline

"

          Key| Value

          A| sum([Betrokken bij echtscheiding <18])/sum([Jongeren onder 18 jaar])*1000

          B| sum(#(vExpr)) / 1000

          C| sum(if(Flag = 3, 0, 1))

" (delimiter is '|')

;

  • The [ and ] have been replaced by double quotes (yes this is legal and it works) so your expressions can contain a closing ].
  • The comma separator has been changed to a pipe (|) so that your expressions can contain commas,
  • and the $() expansions have been suppressed by loading with a # in place of the $, and then replacing the # with a $ in the preceding load. This is so that the $ expansion is performed when the expression is evaluated in the front end and not in the script.

This inline load statement ran OK in QV 10SR5

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
pauldamen
Partner - Creator II
Partner - Creator II
Author

Great! Now I am able to load the formulas.

Next question; how can I use them in the table. The top table is the dynamic table which should show the value selected in the list.

The below table is an example what the second formula should look like if selected.

I attached a new file

Hope you can help!

Gysbert_Wassenaar

Your expression should now be $(=Value) to evaluate the expression.


talk is cheap, supply exceeds demand
pauldamen
Partner - Creator II
Partner - Creator II
Author

As soon as I put a $ sign in front of the expression it turns it into a variable and doesn't recognize the field Value anymore

Gysbert_Wassenaar

Yes, $Value is not $(=Value).


talk is cheap, supply exceeds demand
pauldamen
Partner - Creator II
Partner - Creator II
Author

Sorry but I don't understand. I attached the latest version of the file.

Thanks for all your help

Gysbert_Wassenaar

You changed your fieldname from Value to Variable. Since I can't read minds that means I still was working on the assumption that it was named Value. If you change the name of the field that means you'll have to change your expression too: $(=Variable)


talk is cheap, supply exceeds demand
pauldamen
Partner - Creator II
Partner - Creator II
Author

Sorry I changed the name when testing something.

But still if I put variable it doesn't work, as soon as you put a $ sign and put brackets around it, it turns grey and makes it a variable not recongnizing the field.