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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

Pivot Table

Hi

In my QV document I have a pivot table like given below

FMonth_YearREVENUECOST
Jul-2015197,629,999115,393,118
Aug-2015205,184,56290,634,108
Sep-2015205,310,127118,830,858
Oct-2015213,414,146116,829,218
Nov-2015210,071,164112,696,709
Dec-2015248,441,458130,523,044
Jan-2016215,390,668113,932,903
Feb-2016222,553,371115,182,775
Mar-2016221,173,065122,596,194
Apr-2016228,302,910112,877,640
May-2016222,898,991116,353,477
Jun-2016231,572,131128,801,425

I want to insert columns in this Pivot table which should be as follows

     

FMonth_YearREVENUERev.IncreaseCOSTCost Increase
Jul-2015197,629,999 115,393,118
Aug-2015205,184,5627,554,56290,634,108(24,759,010)
Sep-2015205,310,127125,566118,830,85828,196,750
Oct-2015213,414,1468,104,019116,829,218(2,001,640)
Nov-2015210,071,164(3,342,982)112,696,709(4,132,509)
Dec-2015248,441,45838,370,294130,523,04417,826,335
Jan-2016215,390,668(33,050,790)113,932,903(16,590,141)
Feb-2016222,553,3717,162,703115,182,7751,249,872
Mar-2016221,173,065(1,380,306)122,596,1947,413,419
Apr-2016228,302,9107,129,845112,877,640(9,718,553)
May-2016222,898,991(5,403,920)116,353,4773,475,836
Jun-2016231,572,1318,673,140128,801,42512,447,948

my expression is as follows

SUM({<DESCRIPTION={'TOTAL_REVENUE'}>}ACTUAL)     // for Revenue

SUM({<DESCRIPTION={'COST'}>}ACTUAL)    // FOR  cost

Pls help me to write expression for revenue increase and cost increse over the last month

1 Solution

Accepted Solutions
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

In expression try using this:

=sum(COST) - above(sum(COST))

You should get something like this:

Screenshot_3.jpg

View solution in original post

10 Replies
PrashantSangle

Hi,

check above() or below() in help it will help you.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
upaliwije
Creator II
Creator II
Author

Could you please modify my expression

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

LOAD Date(date#(FMonth_Year, 'MMM-YYYY'), 'YYYY-MM') as FMonth_Year

     ,replace(REVENUE, ',','') as REVENUE

     ,replace(COST, ',','') as COST

FROM

[https://community.qlik.com/thread/226161]

(html, codepage is 1257, embedded labels, table is @1);

Result:

Screenshot_3.jpg

Pivot expression:

=Cost - above(Cost)

Take a look to the attachment.

Frank_Hartmann
Master II
Master II

try like this:

Unbenannt.png

migueldelval
Specialist
Specialist

Hi UPali,

Try this example please

Regards

Miguel del Valle

upaliwije
Creator II
Creator II
Author

Thanks Dear

Your answer perfectly match my requirement. But I have one more question That is I want to show the increase amount in  Bar Char. I want to show only the increase Amount. Is it possible? if So pls help me

PrashantSangle

If you want it in bar chart then In chart property > expression tab > select expression > untick bar.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
migueldelval
Specialist
Specialist

Sample.jpg

Like This?

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

In expression try using this:

=sum(COST) - above(sum(COST))

You should get something like this:

Screenshot_3.jpg