Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Default selection in Month field based on a value in another field - Urgent help

Hi All,

  I have a field named [Latest Date] which contains a value   2011-12 which means Dec 2011.I have a month field which contains data Jan-Dec.If suppose my value in the [Latest Date] is Nov then when i click on the button I should be able to select data from Jan-Nov and in the same way if [Latest Date] contain Sep as data then by clicking on the button I should be able to select data from JAn-Sep.. I mean to say based on the data in [Latest Date] I should be dynimically able to select the appropriate months in the Month field.Currently I am doing this manually I want to do the same dynamically.

Any help would be greatly appreciated..

Thanks in advance..

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     You used 1(one) instead | (pipe symbol)

='('&Concat(Distinct Month(ValueLoop(YearStart(Date#(Max([Latest Date]),'YYYY-MM')),MonthStart(Date#(Max([Latest Date]),'YYYY-MM')))),'|')&')'

Celambarasan

View solution in original post

9 Replies
Not applicable
Author

Any suggestions from any one would be grealty appreciated..

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Did you tried with search string as

     ='('&Concat(Distinct Month(ValueLoop(YearStart(Today()),MonthStart(Today()))),'|')&')'

Hope it helps

Celambarasan

Not applicable
Author

on my understanding to your question  need year to date values, just ytd function in qlik view which wil help you to give the values based on latest date field column. If my understanding is not correct, please brief ur question.

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     If you need to do selection only means use below

      ='('&Concat(Distinct Month(ValueLoop(YearStart(Max([Latest Date])),MonthStart(Max([Latest Date])))),'|')&')'

     Instead use setanalysis

     Sum({<DateField={">=$(=YearStart([Latest Date]))<=$(=Max([Latest Date]))"}>} Sales)

Celambarasan

Not applicable
Author

Hope ur solution should work.. but the data in my [Latest date] field is a plain text 2011-12 .. It is not in the data format now I face a issue in getting the month out of it.. I can extract it using subfiled but how do i map it with month names.???

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     If you need to do selection only means use below

      ='('&Concat(Distinct Month(ValueLoop(YearStart(Date#(Max([Latest Date]),'YYYY-MM')),MonthStart(Date#(Max([Latest Date]),'YYYY-MM')))),'|')&')'

     Instead use setanalysis

     Sum({<DateField={">=$(=YearStart(Date#(Max([Latest Date]),'YYYY-MM')))<=$(=Date#(Max([Latest Date]),'YYYY-MM'))"}>} Sales)

Check with this

Celambarasan

Not applicable
Author

Hi ,

I have made the changes as said by you in the previous mail.. but still I am unable to find the result that i am looking for.. PFA for the expresssion.. I have 2011- 12 in the [Project As of Date].. and I want Jan to Dec values in the month field to be selected.. Can u plz check and tell me where the expression is failing..

Thanks in advance...

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     You used 1(one) instead | (pipe symbol)

='('&Concat(Distinct Month(ValueLoop(YearStart(Date#(Max([Latest Date]),'YYYY-MM')),MonthStart(Date#(Max([Latest Date]),'YYYY-MM')))),'|')&')'

Celambarasan

Not applicable
Author

Oops Sorry I have not noticed that.. It works.. Thanks for ur time..