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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikview979
Specialist
Specialist

varience

HI Experts,

I have pivot table sales ,here i want variance like below

loveisfail‌avinashelite‌jagan‌kush141087‌vikasmahajan‌

Monthname,Sales

Jan,100

Feb,500

Mar,1000

Apr,2000

May,2500

June,3500

Expected O/P:-

400

500

1000

500

1000

regards

Labels (1)
9 Replies
its_anandrjs
Champion III
Champion III

Try this ways

Dim:- Monthname

Expression:- sum(Sales) - Above(Sales)

Regards

Anand

its_anandrjs
Champion III
Champion III

Check the attached file for this

1. First ways          Sum(Sales) - Above(Sales)

2. Second ways     Fabs(sum(Sales) -  Below(Sales) )

Regards

Anand

qlikview979
Specialist
Specialist
Author

Hi all <

how can i do in back end

Regards

Anil_Babu_Samineni
MVP
MVP

Why not this?

LOAD *,Sales - Previous(Sales) as PrevSales; // you can use peek if needed.

LOAD * Inline

[

Monthname,Sales

Jan,100

Feb,500

Mar,1000

Apr,2000

May,2500

June,3500

];

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
effinty2112
Master
Master

Hi Mahesh,

Data:

LOAD

Monthname,

Sales,

Sales - Previous(Sales) as ChangeInSales;

LOAD * Inline [

Monthname,Sales

Jan,100

Feb,500

Mar,1000

Apr,2000

May,2500

June,3500

];

Gives

Monthname Sales ChangeInSales
Jan100 
Feb500400
Mar1000500
Apr20001000
May2500500
June35001000

cheers

Andrew

antoniotiman
Master III
Master III

Hi Mahesh,

You need Order By if Monthname isn't sorted, like this

Table:
LOAD Month(Date#(Monthname,'MMM')) as Monthname,Sales Inline [
Monthname,Sales
Apr,2000
May,2500
June,3500
Feb,500
Mar,1000
Jan,100]
;
Join LOAD *,RangeSum(Sales-Peek(Sales)) as Variance
Resident Table  Order By Monthname
;

If You want 100 as Jan Variance then RangeSum(Sales,-Peek(Sales))    // , added

Regards,

Antonio

its_anandrjs
Champion III
Champion III

As you ask this in the Backend part then go this way

LOAD *,
RowNo() as RID,
Sales - Previous(Sales) as [Expected O/P];

LOAD * Inline
[
Monthname,Sales
Jan,100
Feb,500
Mar,1000
Apr,2000
May,2500
June,3500
]
;


See attached

qlikview979
Specialist
Specialist
Author

Hi All,

Sorry for delay

i am getting correct output in front end ,i need same thing i back end  

I have Date column instead of Monthname ,but i want here monthname wise in back end


Regards

Anil_Babu_Samineni
MVP
MVP

I would ask you to buy qlik cook book or read some fundamentals before using qlikview.

And for your question?

MonthName(DateField) as MonthName //Month(DateField) as MonthName (Just use this)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful