Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
manoranjan_d
Specialist
Specialist

Granularity

Hi,

   

KeyIDCreated dateamountweek
Key1110-Oct-161001
Key1211-Oct-1620001
Key1312-Oct-163001
Key1113-Oct-16154562
Key1214-Oct-1615642
key2315-Oct-16454553
key2116-Oct-161003
key2210-Nov-1620001
key2311-Nov-163001
key2112-Nov-16154562
key2213-Nov-1615642
key3314-Nov-16454553
key3115-Nov-161004
key3216-Nov-1620004
key3317-Nov-163004
key3118-Nov-16154564
key3219-Nov-1615644

Above is my data, I need record count of key for the week, month, quarterly and yearly for max date

example

if the key1 is repeated 4 times in  1st week then record count of key1 shd be 1 and it shd retreive the maximum date only.

if the key1 s repeated 4 times in  oct month  then record count of key1 shd be 1 and it shd retreive the maximum date only, similar to , quarter then yearly

for week it shd be 52

month 12

quarterly 4

and yearly 1

6 Replies
manoranjan_d
Specialist
Specialist
Author

How we ll do this date granularity in the script ?

sunny_talwar

Not sure what is the exact requirement, but please look at the attached

Script:

Table:

LOAD Key,

     ID,

     [Created date],

     amount,

     week,

     WeekEnd([Created date]) as WeekEnd,

     MonthEnd([Created date]) as MonthEnd,

     QuarterEnd([Created date]) as QuarterEnd,

     YearEnd([Created date]) as YearEnd

FROM

[https://community.qlik.com/thread/217568]

(html, codepage is 1252, embedded labels, table is @1);

manoranjan_d
Specialist
Specialist
Author

i cant see the max date for key1

the max date for key1 for 1stweek 12oct2016 and for 2nd week is 14oct2016

the max date for key1 for oct month is 14 oct2016

the max date for key1 for quarterly is 14 oct2016

yearly is 14 oct2016

sunny_talwar

See the max date with their counts?

manoranjan_d
Specialist
Specialist
Author

i cant get you can u say me clearly

sunny_talwar

Like this?

Capture.PNG