Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
smilingjohn
Specialist
Specialist

Previous Date

Hi All,

I have a straight table ...

Now i need to show the sum of revenue for all the months of 2017 and the first 2 rows of the Date field  at the topshould  show, 2 privios yers revenue  that is for 2015 and 2016 and then all the months of 2017 as shown in the image

how can i achieve this please find the attachment and snapshot  and the excel file

For current year ( 2017)  show the Revenue monthly wise and for previous Years (2015 and 2016) we need show the revenue as monthly avaerge.

Under date field the firts 2 rows should show previous year(2015 and 2016 )  and then current years full month


Please someone suggest me

Tahnks in advance

1 Solution

Accepted Solutions
antoniotiman
Master III
Master III

Hi John,

see Attachment.

Regards,

Antonio.

View solution in original post

12 Replies
techvarun
Specialist II
Specialist II

Hi,

check the attached.

techvarun
Specialist II
Specialist II

sample.PNG

smilingjohn
Specialist
Specialist
Author

Hi Varun thanks for the reply ...

I am attaching a excel file how do we handle this here ???

U have got the result from inline table

For current year show the data  monthly wise and for previous yesr we need show the revenue as monthly avaerge

techvarun
Specialist II
Specialist II

Also share the expected output table format and numbers

smilingjohn
Specialist
Specialist
Author

Hi Varun

there is no sample output ...

What you showed above that is how it should look like

but with the excel sheet i have shared

techvarun
Specialist II
Specialist II

Is this what are you looking for?

smilingjohn
Specialist
Specialist
Author

Hi Varun ..

Do i need to keep entering in the futre till 2018 19 ans so inLine table ?

Is ther no other way doing this at expression table ?

smilingjohn
Specialist
Specialist
Author

for previous years it shoul be like AVG(Revenue)

and for current year which will diplsay all the month should be Sum(Revenue ) ..

I dont know how to get this

techvarun
Specialist II
Specialist II

try

If([New Date] = '2015' OR [New Date] = '2016', Avg(Revenue), sum(Revenue))

OR simply

Avg(Revenue)

should work