Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys ive got these 2 tables:
Table1 Expression= Sum (If(Report='current',$(var_sales)))
Header 1 | Header 2 | Header 3 | Header 4 | Header 5 |
---|---|---|---|---|
City | week1 | week2 | week3 | week4 |
Paris | 3424 | 42344 | 224342 | 3242 |
London | - | 4234 | 42342 | 2342 |
New York | 3424 | 4234 | 4234 | 42342 |
Lisbon | 42342 | 4234 | 24432 | 2434 |
Table2 Expression = Logic (just a column name)
Header 1 | Header 2 | Header 3 | Header 4 |
---|---|---|---|
Tier1 | week1 | week2 | week3 |
Paris | YES | YES | YES |
London | YES | YES | YES |
New York | YES | YES | YES |
Lisbon | YES | YES | YES |
Now im trying to insert a rule for the background colouring on the Expression for Table2, what this rule will do is simple but i cant get it to work.
The rull will do is, IF there is a "Yes" on Table2 table AND a NULL value on the Table1 it will color it Red, now i got everything working expect i cant get the verification on the Table1 , the expresssion on that table is "Sum (If(Report='current',$(var_sales)))", what i had was
if(Logic='YES' and isnull(?????), RGB(255,0,0),if (Logic='NO' and ?????<> Null,RGB(255,0,0),RGB(0,255,0)
What it does completely is, if its YES and theres a correspondent value on the other table, then it checks correct and highlights green, now if there is a NO and there is a null on the correspondent table it still checks correct, IT will only Highlight red when, theres is a Yes that corresponds to NUll, or a No that corresponds to a Value, the Formula is not hard, i just dont know what Function to use to tell it to check Table1.
Many Thanks
I'm not sure what you mean by "check table 1". You can't actually refer to values in a different chart. However, since it appears your dimensions are exactly the same, you can just recalculate them in table 2. I also don't recommend using isnull() ever, because it doesn't work correctly in some versions of QlikView. Use len() instead, which seems to work in all versions I've encountered. So something like this, perhaps:
if(Logic='YES' and len(sum(if(Report='current',$(var_sales))))=0,rgb(255,0,0)
,if(Logic='NO' and len(sum(if(Report='current',$(var_sales))))>0,rgb(255,0,0)
,rgb(0,255,0)
Or to avoid doing the sum() twice:
if(len(sum(if(Report='current',$(var_sales))))
,if(Logic='NO' ,rgb(255,0,0),rgb(0,255,0))
,if(Logic='YES',rgb(255,0,0),rgb(0,255,0))
I'm not sure what you mean by "check table 1". You can't actually refer to values in a different chart. However, since it appears your dimensions are exactly the same, you can just recalculate them in table 2. I also don't recommend using isnull() ever, because it doesn't work correctly in some versions of QlikView. Use len() instead, which seems to work in all versions I've encountered. So something like this, perhaps:
if(Logic='YES' and len(sum(if(Report='current',$(var_sales))))=0,rgb(255,0,0)
,if(Logic='NO' and len(sum(if(Report='current',$(var_sales))))>0,rgb(255,0,0)
,rgb(0,255,0)
Or to avoid doing the sum() twice:
if(len(sum(if(Report='current',$(var_sales))))
,if(Logic='NO' ,rgb(255,0,0),rgb(0,255,0))
,if(Logic='YES',rgb(255,0,0),rgb(0,255,0))