Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have this simple code:
=if(sum({$}Month), LightRed(), lightgray())
The only thing I need is to say minus one Month, that is the last one. So if I choose "Jan, Feb and Mar", I need it too remove Mar. If I choose "Jun, Jul", I need it to only use Jun and so forth.
In this case April to July are selected:
Unfortunately it looks like August is selected too. So far "=if(sum({$}Month), LightRed(), lightgray())" is used, and it almost work. Do I really need an extra dataset to make it perfect?
Ok, thx, see last post
I am here btw:
Morning Mikael,
Apprecaite the images, after looking at those and making a few assumptions here is a simple example of what you originally requested.
Richard
ah, thx for the effort
Unfortunately I only have the PE version, until I become skilled enough to get a job working with QV.
Could you plz post the code inside this blog?
script:
// Lets assume this is your data
Original_Data:
Load * Inline [
Month ,Value
Jan ,10
Feb ,20
Mar ,30
Apr ,40
May ,60
Jun ,70
Jul ,80
Aug ,90
Sep ,100
Oct ,110
Nov ,120
Dec ,130
];
// The month is a sting and there are no other Date fields.
// First we need to convert the text into a number
Data:
NoConcatenate Load
Value
,Month as Month_Original
,Month(Date#(Month,'MMM')) as Month_Integer // This is a dual feild so it will read as text but treated as a number
Resident Original_Data;
Drop Table Original_Data;
Use Month_Interger as the chart dimension and the expression is
Sum
( {<Month_Integer={">$(=min(Month_Integer))<=$(=max(Month_Integer))"}>} Value)
A further expression can also be added:
Sum
( {<Month_Integer=>}Value)
Will give you the full year regardless of the selection made in Month_Integer. By promoting it higher than the first epression it will show behind and will give you the same effect as your image.
Richard
You don't have to drop your table. Just add the line transforming the text month into an integer.
I only dropped the table because this is an example.
Richard
Sorry for a late response, but I just want to confirm that it works thx.