Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Find attached, I get data every day and i want the chart to pick the latest data updated everyday. So i wont have to click on date to see current day data.
Rgds
Hi,
to still let the chart react to user selections but start with the last date as default selection, you could also add a field selection action to the document's OnOpen trigger:
To do so, I changed your script to load date as a real date instead of text:
load*,
Date#(Year&'/'&Month&'/'&Day,'YYYY/MMM/D') as date;
//SQL SELECT
LOAD
Actual,
Day,
Month,
Target,
[PS Status],
Year
//FROM GMD.dbo.GMD;
FROM
(txt, utf8, embedded labels, delimiter is '\t', msq, no eof) Where Len([PS Status]);
hope this helps
regards
Marco
Here is what you do.
1. Make the following variables:
a. vToday = today()
b. vYear = Year(vToday)
c. vMonth = Month(vToday)
d. vDay = Day(vToday)
2. Now replace the formula in the chart with this:
=sum({<Year={$(vYear)},Month={$(vMonth)},Day={$(vDay)}>}Actual)
This is similar to saying that, do sum of Actual where Year= current date Year, Month= Current Month, Day = Today's day.
After this you will get what you need.
Check the chart to the right of your chart in the attached QVW. Though the date been taken is 2013/04/02 (instead of today's)
Cheers..
or
Sum({$ <date={"$(=date(Today(), 'YYYY/MMM/D'))"}>}Actual)
Hello,
This is a good one. But most time we have dont have current day data how do we set latest day to show rather than today data.
Rgds
Hi,
to still let the chart react to user selections but start with the last date as default selection, you could also add a field selection action to the document's OnOpen trigger:
To do so, I changed your script to load date as a real date instead of text:
load*,
Date#(Year&'/'&Month&'/'&Day,'YYYY/MMM/D') as date;
//SQL SELECT
LOAD
Actual,
Day,
Month,
Target,
[PS Status],
Year
//FROM GMD.dbo.GMD;
FROM
(txt, utf8, embedded labels, delimiter is '\t', msq, no eof) Where Len([PS Status]);
hope this helps
regards
Marco
Hello Macro
Firstly, Almost what i needed but when i click on clear selection it goes.
Secondly, I followed the same step you took but didnt work.
Hi Emac4444,
2 things you have to do is:-
1- Set up a variable to pick up lates date (i.e vMaxDate = Date(Max([date])))
then in your expression edit it to Sum({<Date = $(vMaxDate)>} Actual).
2- Go to Document Prioperties - Triggers - OnPostReload
Select in Field
Field = [date]
Search String = date= ('$(vMaxDate)')
Hope this helps
Best Regards
Well, he didn't have date in his script. So.