Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

marommishan
New Contributor

Unique Subscribers on monthly basis???

Hi All

I need to make a comparison of months by day using a line chart. The user should be able to click on the yearmonth field to pick the months that they want to compare. (each year-month will be a different line)

The x-axis will contain day numbers i.e., 1 to 31.

The y-axis will contain sales (cumulative daily so on day 1 it will show amount of sales made on day 1 of each month selected, on day 2 it will show the sales for day 1 + sales for day 2 for each month selected, etc)

Thank you in advance for your advice.

PS

I do have a master calendar:

[autoCalendar]:

  DECLARE FIELD DEFINITION Tagged ('$date')

FIELDS

  Dual(Year($1), YearStart($1)) AS [Year] Tagged ('$axis', '$year'),

  Dual('Q'&Num(Ceil(Num(Month($1))/3)),Num(Ceil(NUM(Month($1))/3),00)) AS [Quarter] Tagged ('$quarter'),

  Dual(Year($1)&'-Q'&Num(Ceil(Num(Month($1))/3)),QuarterStart($1)) AS [YearQuarter] Tagged ('$axis', '$yearquarter'),

  Month($1) AS [Month] Tagged ('$month'),

  Dual(Year($1)&'-'&Month($1), monthstart($1)) AS [YearMonth] Tagged ('$axis', '$yearmonth'),

  Dual('W'&Num(Week($1),00), Num(Week($1),00)) AS [Week] Tagged ('$weeknumber'),

  Date(Floor($1)) AS [Date] Tagged ('$date');

DERIVE FIELDS FROM FIELDS [Date], [pas.Date],[Loan Date], postingdate, loandate USING [autoCalendar] ;

Screenshot (2).png

My current attempts which are not working:

//= sum({< [Date.autoCalendar.Date]= {">=$(=MonthStart(Today()))<= $(=MonthEnd(Today()))"}>} [Unique Subs])

//Sum([Unique Subs])

//Sum({$<[Date.autoCalendar.Month] = {='Month(today())'}>}[Unique Subs])

5 Replies
zebhashmi
Valued Contributor

Re: Unique Subscribers on monthly basis???

try

= sum({< [Date.autoCalendar.month]= {$(month(today()))} >}[Unique Subs])

drillnaut
Valued Contributor

Re: Unique Subscribers on monthly basis???

Would he not have to use something like MonthYear since we can have the same "Month" over many years?

zebhashmi
Valued Contributor

Re: Unique Subscribers on monthly basis???

I agree. that what I try to make his focus

Digvijay_Singh
Honored Contributor III

Re: Unique Subscribers on monthly basis???

May be something like -

rangesum(Sum(Sales) + Above(Sum(Sales))

marommishan
New Contributor

Re: Unique Subscribers on monthly basis???

You and Justin are making a lot of sense. I have a yearmonth dimension but I am not sure how to work with it. How would you do it?