Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I'm new to this forum and relative new the QlikView. I've got a question about the creation and usage of variables and I hope you can give me some hints into the correct direction. At the moment, I use a standard load format to load my data (from excel and an Oracle db). To display this data, I use the 'Standard Table Graph' to display these values. Recently, I discovered that I can color these values according to an expression.
However, I've got a question about creation a new variable in a load script (per object: Artikelnummer) dynamically (so, a expression in the load like: value = (x * y) / z). I plan to use this value to define in which color my table row has to be painted. X, y and z have to be values from the excel file or Oracle database.
Could you point me to any documentation describing this process or give me a simple example? Thank very much in advance!
Martijn te Molder
If I understand, you can use like this:
LOAD
X, Y, Z,
X*Y/Z AS value
FROM Excel.xls...
If I misunderstood, please post your qvw example
Hello,
thank you for the quick reply! Would you like me to post the whole import script, or the file itself? I tried to create a new variable in the load script, but it didn't work.
Regards,
Martijn te Molder
please, post your qvw
Hereby, an example of my project. I coudn't send the original due to the data content. This version is an similar version. I would like to color the items in the row, depending on a new dynamic variable, created in the load script per object. The formula can be simple (like artikelnummer * 2).
Kind regards,
Martijn
see in attachment.
I don't understand how you want manage color, but I create a example with green color for last column (see backgroung color expression in last expression)
Thank you for your answer, but I'm afraid that I didn't solve my 'problem'. It seems to be that my explanation isn't clear:
I know how to change (background) colors in tables etc. However, I want to change the background color of tables, depending on a new variable. So I wan't to calculate the variable once per object, and use it to make a simple color statement. The statement to change the color is:
If( (newValue > 10) , RGB(252,115,98))
So far the easy part. Now, I want to define and calculate this newValue (somewhere, probably in the load script) per object row. So each row in the table, can have this color, or not, depending on the new variable.
I hope this wil make my question more understandable.
Regards,
Martijn
ok, calculate your new field (as I wrote earlier) in the script:
LOAD
X, Y, Z,
X*Y/Z AS newValue
FROM Excel.xls...
and then check this new value field in background expression.
ok, but is it also possible to paste that into the existing script like:
ODBC CONNECT TO [Excel Files;DBQ=C:\Documents and Settings\martijn.temolder\Desktop\Thinkwise.xls];
SQL SELECT Artikelnummer,
`Artikelomschrijving 1`,
Categorie,
......
(Artikelnummer * 12) AS newValue <<<<----------
FROM `C:\Documents and Settings\martijn.temolder\Desktop\Thinkwise.xls`.`ThinkWise$`;
Because that would be a super sollution!
I solved it, thank you very much! Can resume my work now, thank you again!
Martijn