Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Issue on dates

Hi,

my requirement is to have the selected date range months to appear as  dimensions;

selected date range is the field:PeriodDateFrom and PeriodDateTo.

since i failed to have it as a dimension, trying it as an expression, and tried the below

=Aggr(Only({$<(ValidToDate={">=$(=MonthStart(max(PeriodDateFrom)))<=$(=MonthEnd(max(PeriodDateTo)))"})>}ValidToDate),Monthname(ValidToDate))

but i get an error message.

could someone sort the issue for me?

Labels (1)
4 Replies
sunny_talwar
MVP
MVP

You have probably two options here:

1) Use calculated dimension

If(ValidToDate >= PeriodDateFrom and ValidToDate <= PeriodDateTo, ValidToDate)

and then check 'Suppress When Value Is Null' option on the dimension tab

2) Or use set analysis to your existing expressions

{<ValidToDate = {"=ValidToDate >= PeriodDateFrom and ValidToDate <= PeriodDateTo"}>}

Not applicable
Author

Hello Sunny,

Thank you for your response, but :

I am going by the first suggestion: calculated dimension( as this will work in my bar chart as well)

this is the calculated dimension i have given ( as without the min n max, the chart showed out of memory)

=monthname(If(ValidToDate >= min(PeriodDateFrom) and ValidToDate <= max(PeriodDateTo), ValidToDate))

SHOWS error in calculation; could you please correct?

sunny_talwar
MVP
MVP

May be try this:

If(ValidToDate >= Min(TOTAL PeriodDateFrom) and ValidToDate <= Max(TOTAL PeriodDateTo), MonthName(ValidToDate))

rubenmarin
MVP
MVP

Hi Mythili, Aggr() expects a dimension name as parameter, using a formula may return unexpected results, maybe:

=Aggr(Monthname(Only({$<(ValidToDate={">=$(=MonthStart(max(PeriodDateFrom)))<=$(=MonthEnd(max(PeriodDateTo)))"})>}ValidToDate)),ValidToDate)


* Not tested, for this to work ValidToDate should be a real date, not a string