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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis with field equal to formula of that field

I've got a data set that has two date dimensions, one is a month end date (called PED), the other is the month I saved the data (called Monthly_DataDate).

I have a List Box setup for Monthly_DataDate so the user can select the data pull they are interested in. I want to have a table that compares the selected month, and the prior month's data set for say sum(Budget) IE:

PED8/1/16 Budget7/1/16 Budget
20161,5001,000
2017500200

I've tried to do something like this:

Sum({$<Monthly_DataDate={'$(=AddMonth(Monthly_DataDate,-1)'}>} Budget)

But I don't get anything back.

I've also tried using a variable:

v_Monthly_DataDate =GetFieldSelections( Monthly_DataDate,';', 1,'Other Reports' )

V_Monthly_DataDate gives me the data I expect, but when I use it in a set analysis, it appears to be ignoring my other filters:

Sum({$<Monthly_DataDate={'$(vMonthly_DataDate)'}>} Budget)

What am I doing wrong?

3 Replies
Anonymous
Not applicable
Author

Hi

try  like this !

For Previous Month:

Sum({$<Monthly_DataDate={"$(=Date(AddMonths(Monthly_DataDate,-1),'MM/DD/YYYY')"}>} Budget)



For Current Month:



Sum({$<Monthly_DataDate={"$(=Date(Max(Monthly_DataDate),'MM/DD/YYYY')"}>} Budget)



//Edited:






Not applicable
Author

That gave me all nulls back. If I change my Monthly_DataDate list box to last month, I get data in the period column, but no mater what date I select it's always null in the last month column.

Anil_Babu_Samineni

You field showing Date Budget. But, while calculating you attempt only Budget. Can you please post sample application and Data which demonstrates the O/P

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