# 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
Did you mean:
Contributor III

## How to create dimension from excel date and how to compare previous vs current year sales

Hi!

From my data sample, how can create a dimension (for example product_sales) that contains sales data?

The chart  expresions must be something like grouping for year,  sum of each product . Ialso need to create expresions that allow me calculate de difference between sales of the selected year respect to the previous one, as well as between the first year and the last year of the my data.

4 Replies
Master

Hi Dude,

Hope ,you forgot to attach your input excel file so it is difficult to understand your requirement for us.

1) =Aggr(Sum(Sales)Year)

2) =Aggr(Sum(Sales)Product)

3) Sum(Sales) Current year vs previous year

else

example like below

Consider you have below script..

================

Sales:

[

Customer, Sales, Year

A, 100, 2012

A, 120, 2013

B, 90, 2012

B, 110, 2013

C, 150, 2012

C, 110, 2013

];

===========================

You can show CY vs LY/PY sales growth as below

Create a Straight Table

Dimension

Customer

Expressions

2012 Sales

SUM({<Year = {2012}>}Sales)

2013 Sales

SUM({<Year = {2013}>}Sales)

Growth

SUM({<Year = {2013}>}Sales)/SUM({<Year = {2012}>}Sales)-1

Don't forget to change Number formatting of Growth to percentage from Properties = Number Tab

4)

Sum( {<Year= Max(Sales Year)>}Sales) This will give last year sales

Sum( {<Year= Min(Sales Year)>}Sales) This will give First/Starting  Year sales

Contributor III
Author
Hi Ramasaisaks!.
Please, check that my sample file is included in my question (file name question.xlsx).
Regards
Master

Hi Francis,

so sorry for my mistake, i didn't observe your attachment.

Actually i was unable to download attachments, Due to some restrictions in my office . sure i will try in my personal machine and will give reply ASAP.

Contributor III
Author
Don't worry!