Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

Set Expression is not Working

Hi All,

I want to show week level data. And only to show data for WeekBeginDate for each week. Not summation of all dates.

I am using below expression:

sum({<DateSel = {Date(CstWeekBeginDate)}>}OrderQuantityOutstanding)

It is not working.

Can you please help me on this.

Thanks,

Sarif

1 Solution

Accepted Solutions
Highlighted
Creator
Creator

Re: Set Expression is not Working

Hi,

You can even create a Master Calendar in you Model having Date and WeekDay and in the Set analysis you can use Weekday = Mon

Sum({<Weekday= {'Mon'}>}OrderQuantityOutstanding)

View solution in original post

8 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Re: Set Expression is not Working

Hi,

The best way is you define this first date in script and create a flag of the same.

So your mastercal should look like below.

Load Date,

        if(Floor(Date) = Floor(weekstart(Date)),1,0) as WeekStartDateFlag

        ....

From xyz;

Now in set expression you just need to use this flag, like below.

Sum({<WeekStartDateFlag = {"1"}>}OrderQuantityOutstanding)

This expression will give you data for only 1st day of the week.

Regards,

Kaushik Solanki

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".
Highlighted
Creator II
Creator II

Re: Set Expression is not Working

is week start Monday? As our DB WeekStart Date is Sunday.

But if i do minus 1 . Then also it is not working.

Thanks,

Sarif

Highlighted
Not applicable

Re: Set Expression is not Working

Can u pls share ur application

or change it weekstart sun in above environmental variables

Highlighted
Creator II
Creator II

Re: Set Expression is not Working

I am not able to find weekstart in Environment variable.

Highlighted
MVP & Luminary
MVP & Luminary

Re: Set Expression is not Working

Hi,

In your environment variable look for

FirstWeekDay, default value is 6 which is sunday, you can make it 0 for Monday.

Regards,

Kaushik Solanki

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".
Highlighted
Not applicable

Re: Set Expression is not Working

Set Daynames is there variable u can change the order of days

Highlighted
Creator II
Creator II

Re: Set Expression is not Working

I set like this:

SET DayNames='Sun;Mon;Tue;Wed;Thu;Fri;Sat';

still not working.

Thanks,

Sarif

Highlighted
Creator
Creator

Re: Set Expression is not Working

Hi,

You can even create a Master Calendar in you Model having Date and WeekDay and in the Set analysis you can use Weekday = Mon

Sum({<Weekday= {'Mon'}>}OrderQuantityOutstanding)

View solution in original post