Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
LINKEDIN LIVE: Democratizing data to enhance customer-centricity. JULY 29TH REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
rammarthi
Creator
Creator

Line Chart with Month Dimension Future Values

Hi All, 

I have a line chart with two expressions one for current year and the other for previous year with Month as dimension. 

I want to show it in such a way that the expression should show the months only till latest month. i.e., if today's month is Nov 2018, it should show all the months of 2017 and Jan to Nov of 2018 and should not show December value as zero.

If I am activating suppress null values, all the zeroes/ months not having data between Nov 2018 and Jan 2018 are also disappearing. But I only want to suppress future values whose data ain't there not past values.

When I am suppress null all the April, May and Dec are vanishing. I dont want April and May with Zeros disappear, I only want Dec to disappear as data is only till Nov.When I am suppress null all the April, May and Dec are vanishing. I dont want April and May with Zeros disappear, I only want Dec to disappear as data is only till Nov.

*Note: We can see only 2018 data as previous year (2017) data is not there yet.

Thanks in Advance

Ram

Labels (2)
1 Solution

Accepted Solutions
rammarthi
Creator
Creator
Author

There is a way to achieve this, one should use the if condition with comparison of latest month end date (vLtstMnthEDt) defined as variable in front end(vMaxSalesDT) and maximum date available in backend. And use the following as expression:

=If($(vLtstMnthEDt)<=$(vMaxSalesDT), aggregation expression, null())

And suppress nulls in the expression presentation. This works.

View solution in original post

13 Replies
zzyjordan
Creator II
Creator II

Hi, Rammarthi
Can you provide a sample data and your two expressions so that it will be easier to provide a solution?
ZZ
joseph_morales
Creator II
Creator II

Hi rammarthi,

Could you indicate what expression are you using in the graph?

regards

 

Best Regards,
Joseph Morales
anushree1
Specialist II
Specialist II

Hi,

I believe the issue is because there is a missing or zero value for a month, so when you visualize it on a chart there is no way a line can be drawn here  for a row with missing  or zero value so its better you see how the data looks like when you have the same dimension and expression is depicted in a straight table so that you get a fair idea on the data , also if you could provide the sample data , it would help in guiding further

uacg0009
Partner
Partner

Hi Rammarthi,

I created some sample values for testing my expression, I think below is what you want:

Line Chart with Month Dimension Future Values.PNG

Aiolos Zhao

rammarthi
Creator
Creator
Author

The expression for each of the years is something like this:

=Sum({<Filter1={1},Filter2={2},Sales_Dt={'>=$(=$(vCurrYrStDt))<=$(=$(vCurrYrEDt))'}>}Sales) for Current Year

=Sum({<Filter1={1},Filter2={2},Sales_Dt={'>=$(=$(vPrevYrStDt))<=$(=$(vPrevYrEDt))'}>}Sales) for Previous Year

Data Sample Attached for reference.

Again we need line chart to show zeros for April and May. And don't show the Dec 2018 at all assuming 2017 all the data is present.

Regards

Ram Marthi

 

rammarthi
Creator
Creator
Author

What ever you are showing for April is good.

Lets assume today's month is Oct. So future Nov and Dec are also showing zeros they shouldn't be shown. 

I just attached data sample for 2018 data please check.

anushree1
Specialist II
Specialist II

Hi,

The sample Data provided does'nt have an entry for  Months  4 and 5 which is April and May Months , also it lacks data for 2017 , so I have tweaked the Excel to have all these information included and created the chart, please check if it works.

So, all you need is to get the complete data say if there is no sales in any month the data must have an entry with a zero value for that month.In case the data cannot be prepared that way we will need to make changes in the Script to include the missing data with zero value in qlikview itself, as in the current state qlikview will otherwise not know that a value is missing and something needs to be done.

Hope this helps

 

 

anushree1
Specialist II
Specialist II

I probably missed the attachment

uacg0009
Partner
Partner

Hi,
I'm not sure whether you see my qvw and my data,
I think the expression is what you want, in the chart, you can see 0 value in last year,
and no value after today's month.
You can try to use it in your example,
if not correct, please tell me.
Aiolos Zhao