Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
venkey2847
Contributor II
Contributor II

showing 2016-Q1 to 2019-Q1 sales

Hi All,

I have sales data from 2016001 to 2020012.

date format is : 2016001 to 2020012.

I need to show only 2016-Q1 to 2019-Q4 in bar chart.

I have created two variables in script for starting quarter(2016-Q1) and ending quarter(2019-Q4).

It is working fine for year and month level data but for quarter only it is not working.

variables for year is:

Let less= Year(Today())-2;
Let great= Year(Today())+1;

expression for year is: Sum({$<[Fisc_Year]={">=$(=less)<=$(=great)"}>}Sales) 

Above expression showing values for : 2016,2017,2018 and 2019.

variables for Quarter  is:

Let vDateMin= Year(Today())-2 &'-'& 'Q1';
Let vDateMax= Year(Today())+1 &'-'& 'Q4';

 

I have used these variables in set expression but I m not getting data.

my expression is:

Sum({<[Fisc Qtr]={">=(vDateMin)<=(vDateMax)"}>} Salary)

 

please find attached files for reference.

Thanks in advance.

 

regards

venkey.

 

14 Replies
venkey2847
Contributor II
Contributor II
Author

its like that onlySmiley Happy

I cant able to share.

Is there any way we can do it in set expression?

 

regards

Venkey.

sunny_talwar

May be try this (not recommended, but if you really want to)

=Sum({<date={">=$(less)<=$(great)"}, [Fisc Qtr] -= {"*-Q0"}>} Salary) 
sunny_talwar

or this

=Sum({<date={">=$(less)<=$(great)"}, [Fisc Qtr] = -{"*-Q0"}>} Salary)

 

venkey2847
Contributor II
Contributor II
Author

Thanks Sunny its working fine.

sunny_talwar

Great, please close the thread by marking the correct answer as the solution.

Best,
Sunny