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

Need Week count

Hi all,

I want to calculate the count of  items   of current week  dynamically   how to write the exp?

I have a weeknumber column in data

=count(Item)

28 Replies
PrashantSangle

Hi there ] in your expression other wise your expression must work.

try after removing it.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
its_anandrjs

Your expression seems ok and working fine try some of this

=count( {<Flag={1},WeekNumber = {" $(=max(WeekNumber))"}>} Item)

Or

=count( {<Flag={1},WeekNumber = {" $(=max(WeekNumber))"}>} [Item])

soniasweety
Master
Master
Author

Expression is showing Ok   but   if I write above  the selection generated for this chart no data it is showing?

and I checked in text object it showing "0"     and   if I  create a listbox for weeknumber   and if I select  30th week that chart is showing values .

sunny_talwar

What other selections are you making?

its_anandrjs

In any straight table check this expression.

PrashantSangle

debug your expression,

like take flag and WeekNumber as list box and take text object with simple expression count(Item)

or you can take Item as list box and check you have Item for respected selection.

Note : Field which you are using in set analysis is case sensitive.

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
soniasweety
Master
Master
Author

sorry guys its working    My bad there is  spaces in the expression ,

I just copied from here and pasted it didn't worked,    then I created new chart and  typed the expression it given.

Thanks for your support

soniasweety
Master
Master
Author

One Quick question,

Sunny Talwar

I have two different tables that's why I created flag in the script  ,

but in  one chart I want to show  both table count  [this is also max week]   and  week column name is different how can I do?

sunny_talwar

May be use Flag as one of the dimension and then use this:

=Count(Aggr(If(WeekNumber = Max(TOTAL <Flag> WeekNumber), Item), Flag, Item))

its_anandrjs

Then use flag with different expressions because they are in different fields you have to use different expression either make changes in the data model and get this table into single table with table flag.