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: 
Not applicable

Difference Between Actual and Plan

Hi, I am a newbie trying out Qlik Sense. My dataset consists of month, year, sales amount, actual or plan indicator.  For example,

Month      Year      Sales Amount     Act_Plan

1               2016     1000                    Actual

1               2016     1100                    Plan

2               2016     1200                    Actual

2               2016     1300                    Plan

Queries:

1. How do I create a measure to show the difference between Month Actual less Month Plan?

2. If I want to chart this, how do I show the Sales Amount for Actual and Plan side-by-side?

Thank you.

10 Replies
undergrinder
Specialist II
Specialist II

Hi Weng,

The easiest way to do that is reshape your data like this:

Month     Year     Amount_Actual     Amount_Plan

1              2016     1000                    1100

You can achive this at load script like that:

Load

     Month

    ,Year

    ,if(Act_Plan='Actual',"Sales Amount") as Amount_Actual

    ,if(Act_Plan='Plan',"Sales Amount") as Amount_Plan

From .......

I'm sure this can be achieved by set expression too, but it's more simple.

G.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Have a look at the application.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
jonathandienst
Partner - Champion III
Partner - Champion III

For the difference, assuming that year (optionally and month) as dimensions:

=Sum({<Act_Plan = {Actual}>} SaleAmount) - Sum({<Act_Plan = {Plan}>} SaleAmount)

For the chart:

=Sum({<Act_Plan = {Actual}>} SaleAmount)

=Sum({<Act_Plan = {Plan}>} SaleAmount)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
reddy-s
Master II
Master II

Hi Weng,

For the first Query

1) sum({< Act_Plan = {'Actual'} >}[Sales Amount]) - sum({< Act_Plan = {'Plan'} >}[Sales Amount])

2) sum({< Act_Plan = {'Actual'} >}[Sales Amount])

   sum({< Act_Plan = {'Plan'} >}[Sales Amount])

Hope this helps!

Thanks,

Sangram

Not applicable
Author

Thank you.

Not applicable
Author

Thank you.

Not applicable
Author

Thank you.

Not applicable
Author

Thank you. Don't seem to find the app

sfatoux72
Partner - Specialist
Partner - Specialist

‌a variante for the chart:

DImension

  • calculated dimension :   =MakeDate(Year, Month)
  • Act_Plan

Expression

  • Sum(SalesAmount)