Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
sonysree88
Creator II
Creator II

how to get the total sales

 

Needs to display total sales made in each year. But the company maintains its sales transactions with full timestamp (dd:MM:yyyy:hh:mm) not just the year in form of DateOfSale column which is of Date type. What would you suggest Theon to do in order to meet this requirement

 

Which one is correct in the below :

1. In Query Editor, use Year function on DateOfSale column before performing GroupBy on DateOfSale
 
2. In Query Editor, use Year function on DateOfSale column after performing GroupBy on DateOfSale
 
3. In Query Editor, perform GroupBy on DateOfSale column
 
4. Group By is not required at all
 
Labels (1)
1 Solution

Accepted Solutions
anushree1
Specialist II
Specialist II

Use code as below:

Load

field1,

Fieild2,

Sales,

......

Year(DateOfSale) as Year

From....

;

No Need of grp by

use a straight table Dimension: Year(You created in Script) Measure:Sum(Sales)

View solution in original post

2 Replies
pradosh_thakur
Master II
Master II

Why not have a year column as it can be used else where as well and then calculate the total sales by that year column?
Learning never stops.
anushree1
Specialist II
Specialist II

Use code as below:

Load

field1,

Fieild2,

Sales,

......

Year(DateOfSale) as Year

From....

;

No Need of grp by

use a straight table Dimension: Year(You created in Script) Measure:Sum(Sales)