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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Alter Selection - Customize Search

I’ve the DaysName defined in Load Script in following way:


SET DayNames            ='M;T;W;Tu;F;S;S';

(This was a requirement of my client)

In my Dim_Calendar I’ve column that represents the Week Days (W_Day)

Now I have 5 buttons:

  • Monday
    • Alter Selection -> W_Day = ‘M’
  • Thursday
    • Alter Selection -> W_Day = ‘T’
  • Wednesday
    • Alter Selection -> W_Day = ‘W’
  • Tuesday
    • Alter Selection -> W_Day = ‘T’
  • Friday
    • Alter Selection -> W_Day = ‘F’

The action are ‘Alter Selection’ because I want it to be possible to select all days at same time.

Problem:

When I select the button “Thursday” or “Tuesday” it select both values ‘T’ and don’t how can I solve this…

Can anyone help me?

Many thanks!!!

1 Solution

Accepted Solutions
sunny_talwar

Create another field in the script:

Num(WeekDay(Date)) + 1 as WeekDayNum;

and then use this for your button selections

Capture.PNG

Sample Script used:

SET DayNames='M;T;W;T;F;S;S';

Table:

LOAD WeekDay(Date) as WeekDay,

  Date,

  Num(WeekDay(Date)) + 1 as WeekDayNum;

LOAD Date(Today() + RecNo() - 1) as Date

AutoGenerate 50;

View solution in original post

6 Replies
sunny_talwar

Why don't you select Tu for Thursday?

Thursday

  • Alter Selection -> W_Day = ‘Tu’
Not applicable
Author

Hi Sunny T,

I propose that to my client, but he wants that distribution (M;T;W;T;F)

sunny_talwar

But up top you have this in your post:

SET DayNames            ='M;T;W;Tu;F;S;S';

Thursday seems to be Tu

Not applicable
Author

Sorry, my mistake....

I copy the last proposal that have the 'Tu' for Tuesday.

The current script is:

SET DayNames            ='M;T;W;T;F;S;S';

marcus_sommer

It's not quite clear to me how these weekdays will be displayed and selected (beside the why - making easy things complicated)? But anyway, some thoughts which might be useful:

- using from dual-fields with overlapping string-values and different numeric values

- extending the field-values to zero white-space characters

- using from Current Selection Alternatives

- Marcus

sunny_talwar

Create another field in the script:

Num(WeekDay(Date)) + 1 as WeekDayNum;

and then use this for your button selections

Capture.PNG

Sample Script used:

SET DayNames='M;T;W;T;F;S;S';

Table:

LOAD WeekDay(Date) as WeekDay,

  Date,

  Num(WeekDay(Date)) + 1 as WeekDayNum;

LOAD Date(Today() + RecNo() - 1) as Date

AutoGenerate 50;