Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
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.

 

1 Solution

Accepted Solutions
sunny_talwar

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

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

View solution in original post

14 Replies
venkey2847
Contributor II
Contributor II
Author

 
venkey2847
Contributor II
Contributor II
Author

Below attached is qvw file for reference.
sunny_talwar

Why don't you use the same expression for when you Fisc Qtr as a dimension

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

image.png

venkey2847
Contributor II
Contributor II
Author

Thanks Sunny, It is working fine.

But my quarter field having 2016-Q1,2016-Q2----2017-Q1--2018-Q0,2018-Q1,2018-Q2 till 2019Q4.

here 2018-Q0 is having 2018001,2018002 till 2018012 i.e. it is having full year data.

I need to remove from the result dataset.

could you please give me solution for that requirement.

 

regards

venkey.

sunny_talwar


@venkey2847 wrote:

here 2018-Q0 is having 2018001,2018002 till 2018012 i.e. it is having full year data.


2018-Q0? Where do you see this? I am not sure I understand what you are looking to do?

venkey2847
Contributor II
Contributor II
Author

I am telling that in my quarter field I have, so I need to remove.

 

regards

venkey.

sunny_talwar

Are you saying that in your orginial app you have a field value 2018-Q0 and you would like to remove it from your table?
venkey2847
Contributor II
Contributor II
Author

Yes Sunny.

sunny_talwar

This seems like a data issue. Would you be able to share a sample to see why you might even have 2018-Q0 🙂