Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
niharikab
Contributor II
Contributor II

Timechart wizard

Hi Experts,

Can any one please help me to calculate current YTD and Previous YTD using Timechart wizard.ll.png

Please help me on this.

Thanks in advance. 

 

 

3 Replies
pix
Partner
Partner

Hi,

Interesting question as I didn't even know about this option up to your post 🙂

I tried this option with the following steps:

1.  Straight table

2.  First Dimension = CustomerID

3.  Base Expression = Sum(Sales)

4.  Timestamp Expression = OrderDate 

5. Basedate Expression = Today()

6.  Time Period = Year

7.  Checked To Date Mode

In the attached QV file, the expressions generated seems to be OK.

This example might be too simple in comparison to your data model and a different method of calculating YTD vs. Previous YTD might be needed.

Good luck, hope this helps 🙂

niharikab
Contributor II
Contributor II
Author

Hi diana,

I tried YTD and MTD using time chart wizard.But i am unable to get YTD.I am attaching the image as below.Will you please help me.Ytd and Mtd.png

Thanks in advance. 

pix
Partner
Partner

Hi Niharikab,

I see in your screenshot that the years you are working with in your data set are 2014 and 2015.

Due to the function in Basedate expression  which is by default  =today(), the expressions will try to calculate (based on the OrderDate field) the sum of sales  of current year (2018 and that's because of today() function) versus previous year (2017).  Since your data is based on 2014 and 2015 sales, then the result will be 0.

I think you need to analyse what years you want to work with, then maybe create some variables to hold those years; next you'll be able to use those variables in expressions with set analysis for example.

In the file attached, I left same options as before but I modified from the chart properties the expressions generated in the end. Nevertheless, I don't think this is the best option for you as your date references should be flexible. This is why I think you need to create some variables to implement an accurate logic for date analysis so that when new data comes in the application, your expressions will still make sense for the user.

Diana 🙂