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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
sirkyQ
Contributor
Contributor

variables in set analysis

Hi All,

 

I face some issue on while using set analysis. 

 

I have loaded the data

LOAD

DateSK,
Date(Date#(DateSK,'YYYYMMDD'),'MM/DD/YYYY') as ActiveDate, 
LOMAddsSK,
CountriesSK,
CustomerTypeSK,
GenderSK,
LanguageSK,
RankSK,
ItemCateogrySK,
CustomerCategorySK,
AgeGroupSK,
LOMSignupSK,
If(Paid = 'Yes', 1, 0) as [Active Paid],
CustomerStatusSK
//IsTestCustomer
FROM
[C:\Users\smamo\Documents\QlikViewDB\QVDs\DemographicDashboardQVDs\FactDailyActiveCustomers.qvd]
(qvd)
Where Year(Date(Date#(DateSK,'YYYYMMDD'),'MM/DD/YYYY')) >= Year(Today())-1;

 

Then I put the maximum value in a variable

LET vMaxActiveDate = 'Max(ActiveDate)';

Then when I used it in set analysis as a filtering condition

=num(sum({<ActiveDate={'$(vMaxActiveDate)'}>}ActiveCount), '#,##0')

It results 0 but when I put a hard coded date instead of the variable it displays like

=num(sum( {< ActiveDate={"06/30/2019"}>}ActiveCount), '#,##0')

It gives me a result

I also checked my variable value in another check box by giving a value = $(vMaxActiveDate) and it gives me the maximum date

 

Can anyone help me what did I do wrong?

 

 

2 Replies
Frank_Hartmann
Master II
Master II

try this:

LET vMaxActiveDate = '=Max(ActiveDate)';
Brett_Bleess
Former Employee
Former Employee

Did Frank's post resolve the issue?  If so, please give him credit by clicking the Accept as Solution button on his post, and if it did not help, either provide further information, or let everyone know what you did to fix things, and after you post that, you can mark that as the solution as well.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.