Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ! I wanted to know if you could please help me to do this in a Qlikview macro (VBScript). I tried it using this code but it only modifies one whole column, not one specific cell:
set table = ActiveDocument.GetSheetObject("CH47")
set prop = table.GetProperties
for RowIter = 0 to table.GetRowCount-1
for ColIter =1 to table.GetColumnCount-1
set cell = table.GetCell(RowIter,ColIter)
set ev = prop.Expressions.Item(0).Item(0).Data.ExpressionVisual
ev.CellVariations(0).TotalBgColor.Col = RGB(100,0,0)
next
next
prop.TableProperties.StyleNumber = -1
table.SetProperties prop
THANKS!
Hi,
You can do this without macro.
Go to properties of chart -> Expression Tab-> Click + sign.
Here you will find the option called, Background color.
Clik on it.
At right type the condition below the definition.
Say for example.
if(Sum(Value) =100, rgb(100,0,0))
Regards,
Kaushik Solanki
Hi,
Seems that you want to change the colors of the rows and column of the chart..?
Regards,
Kaushik Solanki
Hi,
First I check if the content of that cell of the straight table meets some conditions, if it doesnt meet them, I want to change the background colour of that specific cell. Other idea I thought would be to add a flag in another cell in the straight table, for example setting that cell with the value "N", but I dont know how to do it in a macro either.
Thanks for your help.
Hi,
You can do this without macro.
Go to properties of chart -> Expression Tab-> Click + sign.
Here you will find the option called, Background color.
Clik on it.
At right type the condition below the definition.
Say for example.
if(Sum(Value) =100, rgb(100,0,0))
Regards,
Kaushik Solanki
The problem is that that content in the cell has to meet several conditions. To be more specific, that cells contains a name, for example ABC:EUROPE:02 , and I have to check if that name is valid according to several rules (for example that the first parts is only 3 characters, that the second one is a valid continent, etc) . So I think such a complicated condition is not possible to do it adding an expression in the Table settings/Background Color, etc
What do u think?
Thanks again for your super fast reply.
HI,
It is possible, how can you conclude without trying it.
Regards,
Kaushik Solanki
Is there any function there to parse a String according to one character? I mean, if you have for exampe ABC:EUROPE:02 , to get an array or something like that with ABC , EUROPE and 02 (the fields separated by the character ":"
Thanks
Hi Yo,
If you think you have so many conditions to check for, then do it in the script. Create flags and then use in the condition. That will reduce your big formula and also it will give better performence.
Hi,
Yes there are many string functions available in qlikview.
Go to help and find string functions.
One of them is subfield.
Regards,
Kaushik Solanki
And is it possible to write there a whole code defining expressions, with loops and so on?