Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
My dimension for the bar chart is date field, there are almost 150 values(5 months) in it but I want to show only one month data(latest month).
Thanks.
Expression: sum({<DateField={">=$(=Num(MonthStart(Max(Datefield))))"},Year=,Month=,DateField>}value)
use calculated dimension
=date(max(monthname(Date)),'MMM-YYYY')
Hi,
Create a calculated dimension or use set analysis.
Calculated Dimension date(max(monthname(Date)),'MM-YYYY')
Regards,
Thank you all for your quick response,
My bad I didn't put question in right way,
I am expecting latest month i.e., 30 bars in bar chart.
Try this
=sum({<DateField={">=$(=date(monthstart(max(monthname(Datefield))),'YourDateFieldFormat'))<=$(=date(monthend(max(monthname(Datefield))),'YourDateFieldFormat'))"},Year,Month,DateField>}value)
have you resolved ?
last 30 days?
sum({$<year=,month=,date={">=$(=date(today()-30))<=$(=date(today()))"}>} value)
Like this?
Since 6/14/2015 is the max date in the database, you will see the bar chart starting from 5/15/2015 and goes up till 6/15 2015 (30 days)
Expression:
=Sum({<Date = {"$(= '>=' & Date(Max(Date)-30) & '<=' & Date(Max(Date)))"}>}Value)
I used just date here without specifying its format because I used Date() function in the script also which takes the same format that I specified at the beginning of my script:
SET DateFormat='M/D/YYYY';
Table:
LOAD Date(41639 + IterNo()) as Date,
Ceil(Rand() * 100000) as Value
AutoGenerate 1
While IterNo() <= 530;
You may not be using Date function for you date. and if that's true than you would need to use the same format as you date in the set analysis function:
=Sum({<Date = {"$(= '>=' & Date(Max(Date)-30, 'yourDateFormat') & '<=' & Date(Max(Date), 'yourDateFormat'))"}>}Value)
I hope this would help you.
Best,
Sunny
Hi
Please use calculated dimension like this. Hope this will help you.
=date(max(monthname(Date)),'MM-YYYY')