Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using DSE in 'FROM' statement

I am loading data from a website. The FROM statement is as follows:

http://finance.yahoo.com/q/hp?s=%5EDJI&a=4&b=6&c=2013&d=4&e=6&f=2014&g=d&z=66&y=$(vWeb_Page_Counter)]

The DSE for vWeb_Page_Counter works flawlessly.  However, when I try to use DSE for the input variables of a, b, c, d, e or f, it does not work the way I expect it.  For instance, I would like the 'b' variable to be defined as such:  b=$(Begin_Day_Select).  If I leave b as a number (such as 6 shown above) it works fine.  However, when I try to define it using DSE it does not work as I anticipated.  For example, the above statement gives me the closing price for the DJIA for every day the market was open between May 6, 2013 and May 6, 2014 (the month is actually defined as month number less one such that Januaray would be defined as 0 and December would be defined as 11).  When I try to use DSE for b, it goes all the way back to Jan 14, 2013.  I did not change the 'a' variable so the month did not change.  So I cannot figure out why it goes back to January as that was never changed nor the 14th as the value of $(Begin_Day_Select) is 6.  I have used text boxes to confirm what the DSE value is for each Day, Month and Year.  The actual DSE calculation provides the correct value.  It just seems to not function correctly when I try to use the DSE in the FROM statement.

1 Solution

Accepted Solutions
Not applicable
Author

Dariusz,

I got it to work, but I am not quite sure why it does.  Maybe you could shed some light as to why.  Anyway, I have my user enter the dates for the period for which they want to load the market close information.  I then had the calculation of these variables defined in my variable table.  I then reomved the calculation from the variable table and calculated them using LET statements in the script.  For example, LET Begin_Year_Select = Num(Year(vBegin_Date));.  I then placed the DSE in the FROM statement and it works flawlessly.  I don't think I understand why moving the calculation from the variable table to the script made the difference.  It was getting the right values before.  If you can't explain it, NBD.  I just wanted to know for future reference.  Thanks!

Alex

View solution in original post

4 Replies
Not applicable
Author

Hi Alexander,

may you attach sample app?

regards

Darek

Not applicable
Author

Here ya go.

On Mon, May 12, 2014 at 4:14 PM, Dariusz Mielczarek <

Not applicable
Author

Dariusz,

Did you receive the copy of my app?

Alex

Not applicable
Author

Dariusz,

I got it to work, but I am not quite sure why it does.  Maybe you could shed some light as to why.  Anyway, I have my user enter the dates for the period for which they want to load the market close information.  I then had the calculation of these variables defined in my variable table.  I then reomved the calculation from the variable table and calculated them using LET statements in the script.  For example, LET Begin_Year_Select = Num(Year(vBegin_Date));.  I then placed the DSE in the FROM statement and it works flawlessly.  I don't think I understand why moving the calculation from the variable table to the script made the difference.  It was getting the right values before.  If you can't explain it, NBD.  I just wanted to know for future reference.  Thanks!

Alex