Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set variable value.

   I have set the variable value in query editor.

SET VarValue = 34;

and also set this value in the sql where condition.

select * from

[AdventureWorksDW]

[DimCurrency] 

where  CurrencyyKey = $(VarValue);

in the designer i used input text box to change the variable value  to populate  table box at the run time but its not changing. may i know where  i am doing wrong or i am missing some steps?

4 Replies
Not applicable
Author

You have to remove the SET VarValue=32. Every time you run the script it Will be set to 32 again, regardless of whagt you do in your GUI- input.

Anonymous
Not applicable
Author

Hi javedkha,

    

               Try this is your query editor

    

                         set varValue = $(var1)

                    Here the "var1" is an another variable . you can create this variable in your presentation file (Settings-->Variable Overviews)

then create one input box with the variable of "var1" ,enter your value  and reload it...

Not applicable
Author

Like vegar said, you only need to delete the line "SET VarValue = 34;" of your script.

The variable already exists, and every time that you run your script the value is being setted to 34...

Good luck

Bruno

Anonymous
Not applicable
Author

or try:

        if IsNull(varValue) then; SET varValue             =      '32';           end if;