Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

jigonzalez
New Contributor III

Set Analysis

Hello, good if someone can help me please, I would appreciate it very much.

I need that the day, month, year, date not only correspond to that variable, but to another that is called vMaxDay.

Current code:

sum ({<day, month, year, Date = {"$ (vLastDay)"}, FLAG_TITLE = {'S'}, CATEGORY = {'Available for Sale'}>} PRICE_MERCED)

4 Replies
Digvijay_Singh
Honored Contributor III

Re: Set Analysis

Do you mean Date needs to be compared with vLastDay AND vMaxDay? Are these variables assigned Date value in date format?

sum ({<day, month, year, Date = {$(vLastDay)>*<day, month, year, Date = {$(vMaxDay)>+< FLAG_TITLE = {'S'}, CATEGORY = {'Available for Sale'}>} PRICE_MERCED)

jwjackso
Contributor III

Re: Set Analysis

If Date is your transaction date and the variable vLastDay and vMaxDay are in the same format, you could try the following if you are trying to get data between the 2 dates:

sum({<Date={">=$(vLastDay),<=$(vMaxDay)}, FLAG_TITLE = {'S'}, CATEGORY = {'Available for Sale'}>} PRICE_MERCED)


Also check out creating a calendar table, How to create a Calendar

Once you have a calendar table you can build variable for different time periods, like a prior MTD and just drop the variable into the set analysis.

LET vPriorMTD = Replace('MonthID = {"@(=Max(MonthID) - 1)"}, Date =  {"<=@(=AddMonths(Max(Date), -1))"}','@','$');

jigonzalez
New Contributor III

Re: Set Analysis

Thanks Digvijay, Let me check the code.

jigonzalez
New Contributor III

Re: Set Analysis

Thanks Jerry for your valuable contribution. I will keep in mind to create a Calendar.

Community Browser