Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
mhmmd_srf
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
prachisangewar
Creator
Creator

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
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

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

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

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

Not applicable

Can u pls share ur application

or change it weekstart sun in above environmental variables

mhmmd_srf
Creator II
Creator II
Author

I am not able to find weekstart in Environment variable.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

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

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

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

mhmmd_srf
Creator II
Creator II
Author

I set like this:

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

still not working.

Thanks,

Sarif

prachisangewar
Creator
Creator

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)