Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Note: You may notice some temporary visual or styling issues in the Community. Our vendor is actively investigating.
cancel
Showing results for 
Search instead for 
Did you mean: 
ReneDiM
Contributor
Contributor

How to get the Month to Month Variation Porcentage

I got he following case:

Loading a monthly inventory of materials like this:

MATERIAL - Name of the Material

VALUE - The value of the Material

EJERCICIO - The month in number (1-12) of the inventory

PERIODO - The year in number (2022) of the inventory

In the load script, I created other variables to convert these to dates:

MonthName(EJERCICIO & '-' & PERIODO & '-01') AS MESYY,
Month(EJERCICIO & '-' & PERIODO & '-01') AS MES,
Date#('01/' & PERIODO & '/' & EJERCICIO ) AS FECHAMES,

We need to get the change in percentage of the value of the inventory the current month vs the prior month.

I have tried several tricks but to no avail.

Any suggestions?

 

 

Labels (2)
1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

Try Before() instead of Above().

View solution in original post

5 Replies
hic
Former Employee
Former Employee

You write that EJERCICIO is the month and the PERIODO is the year. Isn't it the other way around?

If PERIODO is the month and the EJERCICIO is the year, you should in the script have

Date(MakeDate(EJERCICIO,PERIODO),'YYYY-MM') as MESYY

and in a chart you should have

Dimension 1: MATERIAL
Dimensions 2: MESYY
Measure: Sum(VALUE) / Above(Sum(VALUE)) - 1

ReneDiM
Contributor
Contributor
Author

You are right, I misplaced the names of year and month. The right ones are:

PERIODO  - The month in number (1-12) of the inventory

EJERCICIO- The year in number (2022) of the inventory

ReneDiM
Contributor
Contributor
Author

This works ONLY if the "Month" Dimension goes vertically, so that the value for the prior month is -as you expect- above the value for the current month.

That is not our case. We want to deply the values month by month in a horizontal line. 

ReneDiM_0-1670966188282.png

But we need this:

ReneDiM_1-1670966274841.png

ReneDiM_2-1670966290836.png

Any ideas?? THANKS!

 

 

hic
Former Employee
Former Employee

Try Before() instead of Above().

ReneDiM
Contributor
Contributor
Author

That one did the trick!!

Thanks a lot.

Have a nice one.

 

René.