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: 
paulyeo11
Master
Master

Case 940 How to get 0.25 when i click on Total_GP ?

Hi All

I have below load script :-

Accounts_001:

LOAD * INLINE [
Cost,SOURCE,DocNum,Total,Customer_Name
2,A,1,3,SERVO ENGINEERING SDN BHD
3,A,1,4,SERVO ENGINEERING SDN BHD
4,A,2,5,SERVO DYNAMICS SDN BHD

];

WhatIfDimension:
LOAD * INLINE [
Pls select 61st Dim,Column61
Total_Amount,Total
Ave_SQ_Amt,Total
Total_SQ,DocNum
Total_Cost,Cost
Total_GP,Total

];

For Each i in 501
WhatIfDimension$(i):
LOAD * INLINE [
Pls select $(i)st Dim,Column$(i)
SOURCE,SOURCE
SQ_Num,DocNum
Total,Total
Customer_Name,Customer_Name
Cost,Cost

];
NEXT i;

May i know how to get Total_GP = (12-9)/12 = 0.25

paulyeo11_0-1600941986668.png

From above result i get 12,

https://www.dropbox.com/sh/a1j18og9l6u5fxc/AACKTenLLG0CqDhwvMSTKG2wa?dl=0

Above link is my QVW doc.

 

Paul

1 Solution

Accepted Solutions
Kushal_Chawda

@paulyeo11  try below expression

(sum($(=only({<[Pls select 61st Dim],Column61={'Total'}>}Column61)))-sum(DISTINCT $(=only({<[Pls select 61st Dim],Column61={'Cost'}>}Column61)) ))/
sum($(=only({<[Pls select 61st Dim],Column61={'Total'}>}Column61)))

 

View solution in original post

3 Replies
Taoufiq_Zarra

@paulyeo11  can you elaborate ?

how you get 0.25 ? for Total_Gp ? and what about Total_SQ,... ?

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Kushal_Chawda

@paulyeo11  try below expression

(sum($(=only({<[Pls select 61st Dim],Column61={'Total'}>}Column61)))-sum(DISTINCT $(=only({<[Pls select 61st Dim],Column61={'Cost'}>}Column61)) ))/
sum($(=only({<[Pls select 61st Dim],Column61={'Total'}>}Column61)))

 

paulyeo11
Master
Master
Author

Thank you Kush , it work fine