Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Sum based on different dimension date - Set Analysis

Hi all -  I'm struggling to solve a problem. Any help would be much appreciated. I'm using the following tables.

I'm trying to create a pivot table that will have Conf_Name, Conf Date as dimension. The expression should show sum of all sales$ after the respective Conf_Date for each Conf_Name. We wanted to know how much sales came in after the Conf was held. I'm using the below expression and it works fine only when I select a Conf Name from the List box. If none of the Conf names are selected, the pivot table shows no data and its blank, even dimension values are disappearing. I would like to show all the Conf names in the pivot table and sales after their Conf Date like a summary view. I tried different types of set analysis and nothing worked. Sales date and Conf date are in same format. no issues with data format.

Please help.. I'm breaking my head with this ..

sum( {< [Sales_Date] = {">$(=[Conf_Date])"}>} [Sales_$])


Rep Table
Rep IdRep Name
123John
456Tom
234Jack
853Jim

    

Conference_table
Conf_IdConf_NameConf DateRep Id
ABCLA Conf6/15/2018123
ABCLA Conf6/15/2018456
DEFBoston Conf8/1/2018234
DEFBoston Conf8/1/2018

853

   

Sales Table
Rep IdSales DateSales$
1235/1/2018100
1236/3/2018100
1237/1/2018200
1238/15/2018300
2346/3/2018200
2347/1/2018250
2348/15/2018100
2349/1/2018250

Below is the expected result.     

Expected Results
Conf_IdConf_NameConf DateSales$ After Conf
ABCLA Conf6/15/2018500
DEFBoston Conf8/1/2018350

Thank you.

2 Replies
dplr-rn
Partner - Master III
Partner - Master III

you may need to do something like

sum({<OrderId={'=[Sales_Date] > [Conf_Date]'}>} [Sales_$])

check this out.

set_analysis_intra-record.qvw

vkish16161
Creator III
Creator III

Best to create a flag in the back end.

set hide prefix = '%';

If (Sales Date > Order Date, 1,0) as %Flag_Sales_greater_order

and in front end:

Sum({<Flag_Sales_greater_order ={1}>}Sales)