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

Set Analysis Query

Hi Team,

I have to show count for last 3 months from the month selected by User. If User do not select any month, I have to take max month. Pls Note:

1. Month is the MonthName() actually like Aug 2009, Jul 2009.
2. USDOpenPeriod is the variable that holds the month name from which i have to show last 3 months. I am changing its value On Select of the field. If user clears all selection, it will hold the max month.
3. I can't give "Always Selected One" on month field.

To get the count for Selected (or Max month), I am using below 3 options:







i) count ({$} USD.Callno) - giving correct count

ii) count({<USD.Open_Period=USDOpenPeriod>} USD.Callno) - not giving anything - Expression window also not showing any error in formula.

iii) count(If(USD.Open_Period=USDOpenPeriod,USD.Callno)) - giving correct count

I am not able to understand how ii) is different from i) and iii).

ii) count({<USD.Open_Period=USDOpenPeriod>} USD.Callno) - not giving anything - Expression window also not showing any error in formula.

iii) count(If(USD.Open_Period=USDOpenPeriod,USD.Callno)) - giving correct count

I am not able to understand how ii) is different from i) and iii).

ii) count({<USD.Open_Period=USDOpenPeriod>} USD.Callno) - not giving anything - Expression window also not showing any error in formula.

iii) count(If(USD.Open_Period=USDOpenPeriod,USD.Callno)) - giving correct count

I am not able to understand how ii) is different from i) and iii).



Moreover, to get the count of Previous month of Selected (or Max month), I am trying to do like below:

count({<USD.Open_Period=MonthName(AddMonths(Date#(USDOpenPeriod,'MMM YYYY'),-1))>}USD.Callno)

With this, Expression window is showing error - "Error in set modifier ad hoc expression".

Pls suggest!!










2 Replies
Not applicable
Author

Hi Arun,

hopefully the attached example of "Set Analysis Three Month Period" will help you.

God luck!

Rainer

Not applicable
Author

Hi Rainer,

Thanks for the reply.

I modified my expression -> {"=MonthName(AddMonths(Date#(USDOpenPeriod,'MMM YYYY'),-1))"}

count({<USD.Open_Period={"=MonthName(AddMonths(Date#(USDOpenPeriod,'MMM YYYY'),-1))"}>}USD.Callno)

I m getting the count now but instead of giving -1 in AddMonths, i am getting the count same as Selected (or Max) month.