Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Welcome to our newly redesigned Qlik Community! Read our blog to learn about all the new updates: READ BLOG and REPORTED ISSUES
cancel
Showing results for 
Search instead for 
Did you mean: 
Creator II
Creator II

Creating column with calculated measure 2019-2018

How to create an additional column with the delta between 2019 and 2018 through a calculated measure

What should the expression look like. see attachment. I assume the expression needs to be added when you select add under measure fX and fill in the expression

Labels (1)
12 Replies
MVP
MVP

are there two different expression or just single expression (Consumed Qty)?

Creator II
Creator II

It is 1 variable/metric called consumed YTD (euro) =  Sum([Consumed [YTD]]])  This variable is applicable for 2018 and 2019. File looks like this

Year      product       Consumed YTD

2019        a                     300

2019        b                     500

2018         c                    200

MVP
MVP

what is the expected output need in pivot table?

Partner
Partner

Try to create a measure named "Delta " with the expression 

RangeSum(-Before([Delta ConsumedEuro]), Sum(ConsumedEuro))

image.png

 

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Creator II
Creator II

I am getting an error in the expression. See attachment.

Somehow my default expression is [Consumed [YTD]]]  not sure why the extra brackets. Just when I add this measure to the pivot  in the measure field it by default looks like this

I have tried with and without the extra brackets

Partner
Partner

Try to  replace the outer [ ] with " " like this

 "Consumed [YTD]]"

It might help. 

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Creator II
Creator II

Hi thanks. It doesn't work, still have an error. Where in this code do you define that you compare 2019 to 2018?

RangeSum(-Before([Delta "[Consumed [YTD]]]"),Sum("[Consumed [YTD]]]"))

Creator II
Creator II

I just need to have a fairly simple delta  [Qty Consumed [YTD]]]from year 2019 -/- [Qty Consumed [YTD]]]from year 2019

So something like [Qty Consumed [YTD]]]=2019 - [Qty Consumed [YTD]]]=2018

But then in the right code. Can not find it in the tutorial video's

Creator II
Creator II

Is there someone else who has a different solution? Code above doesn't work for me