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: 
Hamid_Reza_Rashidi
Contributor
Contributor

Two Condition calculation

Hi Everybody,

Please let me have your comments based on followings:

1. My table is as followings:

Date_STech_NoQTYSupplied_Per
139909101207218900
1399091011201200
1399091011202100
13990910100011201
139909111207218900
1399091111201200
1399091111202100
13990911100011201
139909121207218900
1399091211201201
1399091211202101
13990912100011201
139909131207218900
1399091311201201
1399091311202101
13990913100011201
139909151207218900
1399091511201201
1399091511202101
13990915100011201
139909161207218900
1399091611201201
1399091611202101
13990916100011201

2. I am going to have following calculation for :

Sum of QTY for items which their Date_s Is Max and Supplied_Per is 0

Best Wishes.

 

1 Solution

Accepted Solutions
Kushal_Chawda

@Hamid_Reza_Rashidi  try below expression

Sum({<Supply_Per={0},Date_S={"$(=max({<Supplied_Per={0}>}Date_S))"}>}QTY)

View solution in original post

4 Replies
MayilVahanan

Hi @Hamid_Reza_Rashidi 

Try like below

Table1:
LOAD * INLINE [
Date_S, Tech_No, QTY, Supplied_Per
13990910, 12072, 1890, 0
13990910, 11201, 20, 0
13990910, 11202, 10, 0
13990910, 10001, 120, 1
13990911, 12072, 1890, 0
13990911, 11201, 20, 0
13990911, 11202, 10, 0
13990911, 10001, 120, 1
13990912, 12072, 1890, 0
13990912, 11201, 20, 1
13990912, 11202, 10, 1
13990912, 10001, 120, 1
13990913, 12072, 1890, 0
13990913, 11201, 20, 1
13990913, 11202, 10, 1
13990913, 10001, 120, 1
13990915, 12072, 1890, 0
13990915, 11201, 20, 1
13990915, 11202, 10, 1
13990915, 10001, 120, 1
13990916, 12072, 1890, 0
13990916, 11201, 20, 1
13990916, 11202, 10, 1
13990916, 10001, 120, 1
];

Load Tech_No, Max(Date_S) as MaxDate Resident Table1 where Supplied_Per = 0 Group by Tech_No;

Dim: Tech_No

Exp: Sum( {<Supplied_Per={0}>}If(Date_S = MaxDate, QTY))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Hamid_Reza_Rashidi
Contributor
Contributor
Author

Hi, thanks, i am looking for conjunction column 0 and row 13990916 i.e 41000

Date_STech_IDQTYSupply_Per    
13990910897236,0000    
1399091010150    
139909101001020PIVOT TABLE
139909101011501Sum of QTYSupply_Per  
13990911897237,0000Date_S01Grand Total
1399091111210010160139909103600715036157
1399091110010230139909113700915037159
139909111011501139909123800016138161
13990912897238,0000139909133900016339163
1399091210010171139909154000016540165
1399091210010241139909164100016741167
139909121011501Grand Total231016956231972
13990913897239,0000    
1399091310010181    
1399091310010251    
139909131011501    
13990915897240,0000    
1399091510010191    
1399091510010261    
139909151011501    
13990916897241,0000    
13990916100101101    
1399091610010271    
139909161011501    
Kushal_Chawda

@Hamid_Reza_Rashidi  try below expression

Sum({<Supply_Per={0},Date_S={"$(=max({<Supplied_Per={0}>}Date_S))"}>}QTY)
Hamid_Reza_Rashidi
Contributor
Contributor
Author

thanks, it works good