Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Diference in percentage between 2 previous months

Hi, I am new to qlik....

I am trying to create a chart that displays the invoice amounts for the last 2 months and the difference between the month in percentage by Vendor name.

this is what i have loaded.

SET ThousandSep=',';

SET DecimalSep='.';

SET MoneyThousandSep=',';

SET MoneyDecimalSep='.';

SET MoneyFormat='$#,##0.00;($#,##0.00)';

SET TimeFormat='h:mm:ss TT';

SET DateFormat='M/D/YYYY';

SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';

SET FirstWeekDay=6;

SET BrokenWeeks=1;

SET ReferenceDay=0;

SET FirstMonthOfYear=1;

SET CollationLocale='en-US';

SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';

SET LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December';

SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';

SET LongDayNames='Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday';

[Invoice Data]:

LOAD

    "VENDOR ID",

    "VENDOR NAMES",

    "VENDOR TYPE",

    "CONTRACT STATUS",

    "YEAR",

    "MONTH",

    "INV AMT LESS GST",

    "GST AMT",

    "INV TOTAL",

    "NET AMT",

    "INV NUMBER",

    ORIGINATOR,

    APPROVER,

    SOURCE,

FROM [lib://qlikid_lschorr16/VENDOR_ORIGINATOR_CLEAN_FILES.xlsx]

(ooxml, embedded labels, table is [INVOICE DATA 1]);

4 Replies
erjohnso
Creator
Creator

Welcome to Qlik!

I think you want a table with your dimension as vendor and the following expressions:

I would first add a variable in the script:

"YEAR"&"MONTH" as "YEARMONTH",

Current Month:

=sum({<YEARMONTH={"$(=max({<YEARMONTH>}YEARMONTH))"}>} [INV TOTAL])


PreviousMonth:

=sum({<YEARMONTH={"$(=max({<YEARMONTH>}YEARMONTH))-1"}>} [INV TOTAL])

Delta:

[Current Month]/[Previous Month]-1

CarlosAMonroy
Creator III
Creator III

Hi,

Well you need many more things to do to make it happen.

After you load your script you'll need to create the chart, then add the Vendor dimension, then add 2 expressions (one will show the invoice amount for the current month, the other one the invoice amount for the previous months) using set analysis, then add another expression to use the previous expressions and show the % variance.

After doing that you might have some doubts, post 'em to help you in specific issues.

Regards,

Carlos M

Not applicable
Author

Thank you I will give it a try...

Not applicable
Author

Thank you Carlos... i am so new at this i have to clue in how to do anything...