Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
NavinReddy
Creator II
Creator II

Setanalysis

Dear All,

I am using set analysis to display current month salary

=sum({<Date={">=$(=MonthStart)<=$(=MonthEnd)"}>}Salary)

But using this set analysis im getting last month Salary Also

could some one help me to display current month salary only

Thanks In Advance

Niranjan

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Data:

LOAD

Date(Date#(Date, 'DD/MM/YYYY')) AS Date,

Salary

INLINE [

    Date, Salary

    01/01/2014, 100

    03/01/2014, 200

    06/01/2014, 300

    07/01/2014, 400

    10/02/2014, 500

    11/02/2014, 600

    12/02/2014, 700

    13/01/2014, 800

];

=sum({<Date={">=$(=Date(Date#('01/02/2014', 'DD/MM/YYYY')))<=$(=Date(Date#('28/02/2014', 'DD/MM/YYYY')))"}>}Salary)

Regards,

Jagan.

View solution in original post

12 Replies
Not applicable

Hi Niru,

For Ex,

=sum({<Month ='Jan'>}Salary)

Not applicable

Hi,

Hope try this,

Sum({$<Month={$(=Max(Month))}>}[salary])

NavinReddy
Creator II
Creator II
Author

Hi Kumar,

I need to display current month starting date to Till date Salary

Regards,

Niranjan

Not applicable

Are you trying to show the all the dates between start date and end of the month?

NavinReddy
Creator II
Creator II
Author

yes Sneha ......

Not applicable

You can create two variables for current month start date and end date.

And the use can use expression like

=sum({<Date={">=$(=vStart)<=$(=vEnd)"}>}Salary)

preminqlik
Specialist II
Specialist II

hi try this

sum({<Year={$(=max(Year))},Monthnum={$(=max({<Year={$(=max(Year))}>}Monthnum))},Date={'<=$(=max(Date))'}>}Salary)

here for  Monthnum, do in backend like below :

num(Month(Date))               as               Monthnum

NavinReddy
Creator II
Creator II
Author

Yes i Followed the same way

you can check my expression above i m following the same technique

=sum({<Date={">=$(=MonthStart)<=$(=MonthEnd)"}>}Salary)

but im getting last month salary values also

plz help me

Regards,

Niranjan

jagan
Luminary Alumni
Luminary Alumni

Hi,

Check whether dates in the variables and Date dimension are in same format and also check the values in the variables.

If date format differs then it wont work as expected.

=sum({<Date={">=$(=MonthStart)<=$(=MonthEnd)"}>}Salary)


Regards,

Jagan.