Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am looking to utilize an input parameter to query SQL Server. Having a little difficulty doing the following:
If I were utilizing SQL:
Select *
FROM Test
WHERE samplecolumn = ('concat_' + @Variable)
Trying in Qlikview:
select *
from Test
Where samplecolumn = ('concat_' $vVariable)
Getting an error because of the quotes being around the "Concat," but when trying to add around the variable, it is not considered.
Figured it out.
where samplecolumn = 'Concat_$(vVariable)'
Thank you all for your assistance.
Not sure what you want, can you give more details. If you trying in Qlikview then hope below code helps:
select *
from Test
Where samplecolumn = '$(vVariable)'How about this
Load *
from Test
Where samplecolumn = ('concat_' & $(vVariable))
What Ares trying to achieve
I am trying to utilize a variable to complete a string to query on a where statement.
If I were utilizing SQL Server, the query would look like:
declare @Variable as nvarchar(4) = '9999';
Select *
FROM Test
WHERE samplecolumn = ('concat_' + @Variable)
The result would then be:
concat_9999
However, in qlikview, if I declare the variable, vVariable, it is giving me an error.
select *
from Test
Where samplecolumn = ('concat_' $vVariable)
I need Qlikview to take the variable, 9999, and concat for the where statement look like this:
where samplecolumn = 'concat_9999'
The result I am currently getting is:
where samplecolumn = 'concat_' 9999
Which is incorrect syntax for SQL Server.
Figured it out.
where samplecolumn = 'Concat_$(vVariable)'
Thank you all for your assistance.
Create vVariable in the Variable Overview as 9999
Load *
From Test
Where Samplecolumn='concat_' &'$(vVariable)';
There are also couple of ways:
Option I:
LET vVariable= 9999;
LOAD
*
Where Samplecolumn='concat_' &'$(vVariable)';
SQL SELECT *
FROM mydb.dbo.reps;
Option II
LET vVariable= 9999;
LOAD
*
;
SQL SELECT *
FROM mydb.dbo.reps
Where Samplecolumn='concat_' &'$(vVariable)';
Replace "mydb.dbo.reps" with your database and table. Hope this helps...
You might need to include the variable inside of the quotes.
Try it this way and see if it fixes the issue. It is working correctly on my machine:
SELECT *
FROM Test
Where Samplecolumn = 'concat_$(vVariable)';
sounds good, close this thread to put the flag Correct Answer.