Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
I have a filter with Content Year_Month, previously it shows all of the available value for this Coulmn
but now my Customer want me to show just last Month and current Month.
Is there any person who could help me how I can show just current Month and previous Month in my Filter?
I had tried this one but it gives me error
if(zeitpunktverarbeitungYearMonth>=Max(zeitpunktverarbeitungYearMonth)-1,
zeitpunktverarbeitungYearMonth, null()
)
Thanks in advanced
Hi
Looks like your field zeitpunktverarbeitungYearMonth is not a date field as you have "letzte 30 Tage" as a value. So if you need to create this in the interface you have to do something like this where you define each possible value, you can't base it on a "x>Date" condition .
=if(match(zeitpunktverarbeitungYearMonth,
year(today())&'-'&num(month(today()),'00'),
year(monthstart(today())-1)&'-'&num(month(monthstart(today())-1),'00'),
'letzte 30 Tage')
,zeitpunktverarbeitungYearMonth,
Null())
It will work, but will not look very good:
If you instead add something like this in your script:
NoConcatenate
PeriodSelect:
Load
year(today())&'-'&num(month(today()),'00') as zeitpunktverarbeitungYearMonth
AutoGenerate 1;
Concatenate (PeriodSelect)
Load
year(monthstart(today())-1)&'-'&num(month(monthstart(today())-1),'00') as zeitpunktverarbeitungYearMonth
AutoGenerate 1;
Concatenate (PeriodSelect)
Load
'letzte 30 Tage' as zeitpunktverarbeitungYearMonth
AutoGenerate 1;
left join (datetable)
Load
zeitpunktverarbeitungYearMonth,
zeitpunktverarbeitungYearMonth as "Period Selection"
Resident PeriodSelect; drop Table PeriodSelect;
You will get a new dimension you can use instead of zeitpunktverarbeitungYearMonth that will look better for the user:
I think you can create a Dimension that search for these 2 field, the current month and the last month.
And when you add these dimension to your field only appear the 2 field that your customer want.
Create a variable having previous month value, i.e
vprevmonth= month(today())-1 or as depicted if any specific format is being used for the month value then use that, and use it first in a table value to check if the values are actually matching or not.Then use
if (monthfieldname>=vprevmonth, monthfieldname, null())
Most likely the error is due to the mismatch in the search string and the data.
Also, while posting the doubt do provide the error facing and the correct dataset for getting better responses and results.
If( montnOfyourColumn=month (today()) or montnOfyourColumn=month (today()-30) , montnOfyourColumn=month)
Hi,
I would approach this is script, Create a new dimension in your calendar which just populated with the Dates that are equal to this month or last month, then use this field front end,.
Hi
Looks like your field zeitpunktverarbeitungYearMonth is not a date field as you have "letzte 30 Tage" as a value. So if you need to create this in the interface you have to do something like this where you define each possible value, you can't base it on a "x>Date" condition .
=if(match(zeitpunktverarbeitungYearMonth,
year(today())&'-'&num(month(today()),'00'),
year(monthstart(today())-1)&'-'&num(month(monthstart(today())-1),'00'),
'letzte 30 Tage')
,zeitpunktverarbeitungYearMonth,
Null())
It will work, but will not look very good:
If you instead add something like this in your script:
NoConcatenate
PeriodSelect:
Load
year(today())&'-'&num(month(today()),'00') as zeitpunktverarbeitungYearMonth
AutoGenerate 1;
Concatenate (PeriodSelect)
Load
year(monthstart(today())-1)&'-'&num(month(monthstart(today())-1),'00') as zeitpunktverarbeitungYearMonth
AutoGenerate 1;
Concatenate (PeriodSelect)
Load
'letzte 30 Tage' as zeitpunktverarbeitungYearMonth
AutoGenerate 1;
left join (datetable)
Load
zeitpunktverarbeitungYearMonth,
zeitpunktverarbeitungYearMonth as "Period Selection"
Resident PeriodSelect; drop Table PeriodSelect;
You will get a new dimension you can use instead of zeitpunktverarbeitungYearMonth that will look better for the user: