Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello !
Sorry for such a silly question but I need to build a graph from the situation below:
Say that I have a database with STOCK NAME, DATE and PRICE.
I dont know how many different STOCK NAMEs there are on the database.
I'd like to build a graph tracking on the Y-Axis the value, on X-Axis the dates and, for each STOCK NAME there would be a different line .
Would U help me ?
Thanks !
ps : there's a tiny QVW that I hope can be helpful for you !
Hi, see the attached document, and tell me if it works for u
RGDS
Perfect !
Thank U so much !
Now do you know how to make stock prices really go UP ? I mean on the stock market itself ?
See ya !
I don't understand what you want.... are you talking about this setting? Axes->Uncheck Forced 0???
rgds
Sorry I'm just kidding about the stock market.
No one knows how to make it go up.
Anyway, forget about this.
Your answer was perfect.
LOL!!!! xD
Rgds
Hector, I appreciate you providing such a fantastic answer. Unfortunately I can't see it!
I am trying to load the file you provided into the free download version but I get an error message "This file contains inconsistencies and cannot be opened by Personal Edition."
Do you know what this "problem" might be and/or is there a way for me to get around it?
Otherwise, is there some way you could "describe" what the essential part is in order to make sure that a line chart has "multiple" lines, one for each stock symbol. My application has a minimum and maximum number for each symbol so I would really like to lines (or use the min/max feature) but I somehow can't figure out what the magic incantation is in order to get each of the symbols to have their own line in the line chart. When I select more than one symbol it creates a line which is an amalgamation of each of the selected items.
Thanks in advance for any consideration,
Gary
You cannot download other peoples files to personal edition. You can only use your own files, and files that QlikTech themselves have unprotected to allow access.
The first chart has two dimensions, date and stock name. That gives you one line per stock name.
The second chart has only one dimension, date. It then uses one EXPRESSION for each stock of interest, using a sum(if()) to generate the result for that one stock name.
John,
Many thanks for the quick response! I suspected the problem was that I'm not allowed to download files into the personal edition however that was not exactly the error message I was getting. I have tried downloading some other files and do indeed get the message which tells you "if you are running on another computer" kind of thing and that you will essentially lose all of your other files. However, for this particular file, it immediately went to the error message I stated and didn't ever offer me an option to use up one of my 4 chances. (I'm documenting this so you know I am aware of the limitations but this particular file seemed to be "different" than the limitations. 🙂
I believe I am understanding your answer some (and appreciate you helping a newbie). I have tried adding the "Stock name" as an additional dimension because I suspected I needed to have that but, so far, I haven't gotten any more lines.
I am slightly confused by your answer though.
By the way, I am only using "stocks" as an example. That's not the kind of data I'm storing but in my mind the concept is the same so I'm using this analogy so I can figure out what to do without having to over-describe my data. I must admit I'm a bit surprised to not see any example applications which have something to do with tracking historical stock market data for multiple stocks.
Your last paragraph above says "second chart" - by that do you mean the "expressions" tab or a separate graph? Perhaps you're talking about a "combo" chart?
For each "stock" there is a max and min value value associated with a date. I understand putting the date as the Dimension and I am currently putting max and min as the expressions. That only give me 2 lines. I don't understand how to make the "y value" be broken apart into a separate set of max and min for each stock name. As I understand your final paragraph, it would seem that I need to create an "expression" for each stock. I was hoping to choose the names from all of the available ones in the "side boxes" of data and not have to go to the trouble of placing the individual names in the chart. (At least that's how I'm interpreting what you say.) Yes, I realize that the "all" option which would come up first would be very messy, but I can put up with that until I select a few values. 😉
Here's the script.
TEST:
LOAD * INLINE [
STOCK_NAME ;DATE ; PRICE
PETR4 ;02/01/2010 ; 200
PETR4 ;03/01/2010 ; 210
USIM5 ;02/01/2010 ; 30
USIM5 ;03/01/2010 ; 40
] (DELIMITER IS ';');
There are TWO separate charts in the example. The first chart is built like this:
Dimension 1: DATE
Dimension 2: STOCK_NAME
Expression: Sum(PRICE)
The second chart is built like this:
Dimension: DATE
Expression 1: Sum (if(STOCK_NAME='PETR4',PRICE))
Expression 2: Sum (if(STOCK_NAME='USIM5',PRICE))
I'm not suggesting that you do it like the second chart. I'd strongly suggest that you NOT do it that way. But that's what was in the posted example.
Now, it sounds like you're trying to have a graph with TWO lines for every stock, associated with the max and min values for the day? That's where we get into trouble. Basically, you can have EITHER a second dimension OR a second expression, but not both. QlikView is basically telling you that your chart will be too busy, and that you won't be able to distinguish between the min and max lines for each stock. You can fake it, but I don't know of an easy way.
How to do it exactly depends on exactly how your data is stored. And since this isn't your real example, I'm not sure how much detail we should get into with it. But let's say you have a table like the one above, but with a timestamp for every stock sale, so you have every price. The timestamp is then parsed to give you a DATE field, but you'll have many records for each date. You can build a new table like this:
MinMax:
LOAD
STOCK_NAME
,STOCK_NAME & ' ' & subfield('min,max',',') as STOCK_NAME_MIN_MAX
;
LOAD fieldvalue('STOCK_NAME',iterno()) as STOCK_NAME
AUTOGENERATE 1
WHILE len(fieldvalue('STOCK_NAME',iterno()))
;
Which will have a table of all stock names with both 'min' and 'max' after them. Then build a chart like this:
Dimension 1: DATE
Dimension 2: STOCK_NAME_MIN_MAX
Expression: if(right(STOCK_NAME_MIN_MAX,3)='min',min(PRICE),max(PRICE))
There are probably better answers. That's just the first thing that occurred to me.