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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with search string with dates in trigger

Hello,

Can you please suggest me a possible solution to my problem?

I have a master calendar based on 'myDate' with week(myDate), year (myDate), year-week etc. automatically generated for last 4 years. Works well.

Then, i want to have another listbox with year-week.Let's say Year-week2, indepedent from the one in master calendar.Based on this listbox's selection I want to select the previous 12 weeks from master calendar .

For example if I select in this listbox 2012-31, I want selected in my master calendar weeks between 2012-19 till 2012-30.

What I did:

I created an autogenerated calendar for last 4 years based on myDate2. (to be independent from myDate).

Then I added a trigger  on YearWeek2 ->OnSelect> select in field YearWeek. But I got stuck in writing the search string. I want to have something like:

='>=' & YearWeek2-12 & '<=' & YearWeek2-1

Can you please help me?

Thank you

3 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     First Create the Field in Master Calander as

    

     Year(MyDate)&'-'&Week(MyDate) as YearWeek.

    

     Also Create a new field called WeekStartDate

    

     WeekStart(MyDate) as WeekStartDate

    

  

     Now your expression should be like this.

     Sum({<WeekStartDate = {"<=$(=max(WeekStartDate))>=$(=max(WeekStartDate)-84)"}

     ,year=,Month=,YearWeek=,Week=>}Sales)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hello, thank you for your quik answer. this is how I did.Using WeekstartDate

My problem is that I am now allowed to use set analysis expressoins because I want to use 'filtered'WeekstartDate as a dimmension in a graph.

So my option would be with a trigger.

Any suggestions?

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     With the expression I have given you can use the WeekStartDate in Dimension also.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!