Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need Help regarding YTD,LYTD expressions

Hi qlikview USers,

i have the data in the edit script as given below

in that we have 5 fields

i.e.,Quarter,Month,Year,Date,Sales

i want to create a straight tabe with 3 fields

as

Screenshot003.jpg

if i select the date in the date field it should should show according to dat dates

YTD means Year to date

LYTD means LastYear to date

pls give the expressions?

Data:

Load *,'Q'&ceil(num(Month)/3) as Quarter;

LOAD *,Month(Date#(Date,'D-MMM-YY')) as Month,

    Year(Date#(Date,'D-MMM-YY')) as Year;

LOAD * INLINE [

    Date, Sales

    4-Aug-15, 100

    6-Aug-15, 1000

    3-Aug-15, 1500

    1-Aug-15, 2000

    6-Jul-15, 3000

    3-Jul-15, 400

    1-Jul-15, 300

    3-Jun-15, 1500

    6-Jun-15, 1400

    1-Jun-15, 1100

    1-May-15, 100

    1-Apr-15, 1200

    1-Mar-15, 1900

    1-Feb-15, 1300

    1-Jan-15, 1200

    12-Dec-14, 1100

    11-Nov-14, 1055.238095

    10-Oct-14, 1028.809524

    9-Sep-14, 1002.380952

    8-Aug-14, 975.952381

    7-Jul-14, 949.5238095

    6-Jun-14, 923.0952381

    5-May-14, 896.6666667

    4-Apr-14, 870.2380952

    3-Mar-14, 843.8095238

    2-Feb-14, 817.3809524

    1-Jan-14, 790.952381,

   

   

];

4 Replies
Clever_Anjos
Employee
Employee

Use the idea described here: Year-over-Year Comparisons

Kushal_Chawda

Below link will help you to create the expression

https://community.qlik.com/docs/DOC-6163

maxgro
MVP
MVP

see attachment

maximiliano_vel
Partner - Creator III
Partner - Creator III

Attachment