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: 
rathnam_qv
Creator
Creator

Month field count

 

Hi all,

i have MONTH field as a list box...i want to calculate each value count...(ex: if i select Jan then i want to see the value 1, 1nd 2 for Feb,3 for Mar...12 for Dec)

how can we do it....

help me out

Thanks in Advance!!!!!

Smiley

 

3 Replies
swuehl
MVP
MVP

If you have created the MONTH field using the QV function Month(DATEFIELD), then you got a so called dual value, and you get the numeric value by applying num() function:

=num(MONTH)

edit: If your MONTH field is text only, but matches the values of your MonthNames variable set in the script, you can try

=num(month(Date#(MONTHFIELD ,'MMM')))

rathnam_qv
Creator
Creator
Author

Hi Swuehl,

Thanks for your Helpful reply...

my requirement is if i select individual month i will get 1 for Jan.....and so on

if i select Jan ,Feb at a time...

1. Let me Explain like this ...i have Goal Amount in my piviot Table....if i select month individually(Jan....Dec)..my calculations would be =(count(individual month)/12)*Goal Amount....

2. If i select Jan,Feb...(any combination of months)..i want to calculate the above Value

How can we do that....

Thanks in advance

Smiley


swuehl
MVP
MVP

Ah, you don't want to get the month number in the year (Jan=1, Feb=2, etc), but the number of distinct Month values, right?

=count(DISTINCT MONTHFIELD)