Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis problem

Hi!

     I'm sorry for the text (I was helped by Google Translate)

I need to get a score count for the end date of the period grows exactly

I'm using:

= count ({$ <ScoreDate={"=Date(Max(ScoreDate))"}>} Score)

But I get is the same thing as when you use

= Count (Score)

How to do it?

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

In script you flag for the last day of the month by using MonthEnd(), then by using this flag you can easily arrive this

LOAD

     DateField,

     If(DateField = MonthEnd(DateField), 1, 0) AS MonthEndFlag

FROM DataSource;

=Count ({<MonthEndFlag={1}>}Score)

Hope this helps you.

Regards,

Jagan.

View solution in original post

9 Replies
sivarajs
Specialist II
Specialist II

PFA

Not applicable
Author

Hi

create one variable for max date

like varmax

=Max(ScoreDate)

use this expression

sum({<ScoreDate={'$(varmax)'}>}score)

Not applicable
Author

Thanks for the reply!

But this will not work as I need. Maybe you misunderstood me ...

Let me explain more precisely.

Снимок.PNG

I need a column to "Count (Score) on the last date" filled count score of the day "MaxDate".

By month should be the result:

ScoreMonth         Count (Score) on the last date

Jan                                   2

Feb                                  3

Mar                                  1

How to achieve such a result?

Not applicable
Author

Thank you for your option!

This is not quite what I need. See my answer Sivaraj Seeman.

jagan
Luminary Alumni
Luminary Alumni

Hi,

In script you flag for the last day of the month by using MonthEnd(), then by using this flag you can easily arrive this

LOAD

     DateField,

     If(DateField = MonthEnd(DateField), 1, 0) AS MonthEndFlag

FROM DataSource;

=Count ({<MonthEndFlag={1}>}Score)

Hope this helps you.

Regards,

Jagan.

sivarajs
Specialist II
Specialist II

Check the attached file

Not applicable
Author

Thank you for your response. It really works.

The only problem is to make it a universal solution will need to make a separate flag for each of the possible periods (year, quarter, month, week, day).

Until I decide the problem with your method. If I find a universal solution that will write in this topic.

Thank you!

Not applicable
Author

Thank you for your example!

This helped me a lot!

Not applicable
Author

if(Date=Date(Floor(MonthEnd(Date))),1,0) as end_Flag,