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: 
Not applicable

SET ANALYSIS

Dear Team, I have a table like Name , Date, sum(orders) . i want to create on more expression in the Table which sum(orders) - MIN date sum of Orders example given below:

ClientDateOrdersResult
A20-Apr-141000
A21-Apr-1415050
A22-Apr-14200100
B1-Jan-14500
B2-Jan-1410050
B3-Jan-14200150

In the above table result column is the difference ( the difference in future may be in % or other formula also)  of the RED, Clientwise.

13 Replies
Not applicable
Author

Difference should be always from the Minimum date sum of orders

Not applicable
Author

try like this

sum(orders)-aggr(sum(orders),min(date))

Not applicable
Author

sum({<date={$(=min(date)}>}orders)-sum(orders)

Not applicable
Author

I HAVE TRIES ALL NOT WORKING BECAUSE DATE ITSELF IS THE PART OF THE DIMENTION, IF DATE IS NOT PART OF DIMENTION THEN ITS WORKING. SUM( {$} ORDERS)

Not applicable
Author

SUM( {$} ORDERS)

Not applicable
Author

no i could't understand what ur saying pls tell me clearly once

MayilVahanan

Hi

Try like this

ClientTemp:
LOAD Client,
     Date(Date#(Date,'D-MMM-YY'),'D-MMM-YY') as Date,
     Orders
FROM
[http://community.qlik.com/thread/141438]
(html, codepage is 1252, embedded labels, table is @1);

Left Join(ClientTemp)
Load Client, FirstSortedValue(Orders, Date) as MinOrders Resident ClientTemp Group By Client;

LOAD *, Orders - MinOrders as Result Resident ClientTemp;

DROP Table ClientTemp;

Here, Result column gives your output.

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

WHEN I REMOVE THE ORDER_DATE COLUMN FROM THE THE TABLE THEN BELOW MENTION EXPRESSION IS ABLE TO GET THE MINIMUM DATE ORDERS, BUT WHEN I AM INCLUDING THE DATE INTO THE TABLE THEN ONLY MATCHING DATE DISPLAY THE VALUE OTHER DATE SHOW ZERO .. PLEASE FIND ATTACHED SCREEN SHOT FOR OUTPUT

SUM(  { $ <ORDER_DATE= {'$(vMinOrderDate) ' }> } ORDERS)

WHEN DATE IS THERE THEN EXPRESSION SHOW ZERO

Untitled.png

WHEN DATE IS REMOVED ITS WORK FINE

Not applicable
Author

Hi,

I dont want to do with sperate load and temp table etc, is there is any way to do by Set Analysis only ??

it is why when the particular fields is part of Column in the table the set Analysis not work on it ..