Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
bharani8
Contributor III

Set Action for my calculated Date field

Hi Experts - Quick clarification..

I have a Month field in my DB and my calculated expression is like below..

=if((right(Date(if(YDAY=Aggr( NODISTINCT Max(YDAY),Month_Name, Year_Name),YDAY),'MM/DD/YYYY'),4) &

     LEFT(Date(if(YDAY=Aggr( NODISTINCT Max(YDAY),Month_Name, Year_Name),YDAY),'MM/DD/YYYY'),2)) = CALENDAR_YEAR_MONTH_CD,

MonthName((if(YDAY=Aggr( NODISTINCT Max(YDAY),Month_Name, Year_Name),YDAY))))

Now my requirement is ...when i open the Document i need the maximum month to be selected by default.. Since it is a calculated expression, am finding difficult to set an action for this.. Any idea ? how to get this done ?

9 Replies
techvarun
Valued Contributor II

Re: Set Action for my calculated Date field

is it possible to share a sample app?

Thanks

Varun

MVP
MVP

Re: Set Action for my calculated Date field

Could you post a sample? I guess if you have a dual month field, you can just use trigger to select the max of that month field and should work.

Moreover, the expression you are using seems to be one not very optimistic. Perhaps a better performant and easy expression would be there.

MVP & Luminary
MVP & Luminary

Re: Set Action for my calculated Date field

It looks like you could select the maximum value in the YDAY field instead.

If that doesn't give the result you want then I'd try to create a field in the script for the calculated date field instead of trying to use a calculated dimension.


talk is cheap, supply exceeds demand
bharani8
Contributor III

Re: Set Action for my calculated Date field

Hi In the attached qvw file.... i need the below requirements...

1) When i select the month, last date of the month alone should get selected... And that last date will be the value for whole month..

2) When i open the document.. By default the max(YDAY) should be selected..

bharani8
Contributor III

Re: Set Action for my calculated Date field

Plz refer above reply msg (To Varun's)

bharani8
Contributor III

Re: Set Action for my calculated Date field

Plz refer above reply msg (To Varun's)

MVP
MVP

Re: Set Action for my calculated Date field

Like in attached sample?

Field: YDAY

Search string: =Date(Max(YDAY))

bharani8
Contributor III

Re: Set Action for my calculated Date field

Hi  - In ur qvw file.. I need the Sep to be selected and under sep.. max(YDAY)...

MVP
MVP

Re: Set Action for my calculated Date field

Add one more trigger. PFA