Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

set analysis query

Dear experts,

I have Dates(YYYY-MM-DD) as follows,

Date1               Value

2004-04-03        10

2004-06-02        20

2004-11-02        30

2004-03-31        40

2005-04-01        50

2005-10-06        60

2005-03-31        70

2006-04-01        80

2006-06-20        90 

2006-10-30        100 

Now I want YearWise count of Value in a bar chart.

ex. 2004 - 4

     2005 - 3

     2006 - 3

Is this Possible by set analysis????

I tried   :   count({$<Date1 = {'>={$(=min(Date1)) <= {$(=max(Date1))}}'}>}Value)

when no selection is there it will take '2004-04-03' as Min and '2006-10-30' as Max but i want Yearwise in Bar....

Please help on this will be greatly appreciated........

Regards,

Vaibhav

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Please check the attached file for solution.  You can also do this by using Calculated Dimension without adding a new Field(Year). 

If you are using Year in multiple widgets just follow what kaushik suggested.  The script for adding Year Field is below

Values:

LOAD

     Date1,

     Value,

    Year(Date1);

LOAD * INLINE [   

    Date1,  Value

    2004-04-03, 10

    2004-06-02, 20

    2004-11-02, 30

    2004-03-31, 40

    2005-04-01, 50

    2005-10-06, 60

    2005-03-31, 70

    2006-04-01, 80

    2006-06-20, 90

    2006-10-30, 100

];

Regards,

Jagan.

View solution in original post

3 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

     Just include dimension as =Year(Date)

     and expression as count(Value)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
jagan
Luminary Alumni
Luminary Alumni

Hi,

Please check the attached file for solution.  You can also do this by using Calculated Dimension without adding a new Field(Year). 

If you are using Year in multiple widgets just follow what kaushik suggested.  The script for adding Year Field is below

Values:

LOAD

     Date1,

     Value,

    Year(Date1);

LOAD * INLINE [   

    Date1,  Value

    2004-04-03, 10

    2004-06-02, 20

    2004-11-02, 30

    2004-03-31, 40

    2005-04-01, 50

    2005-10-06, 60

    2005-03-31, 70

    2006-04-01, 80

    2006-06-20, 90

    2006-10-30, 100

];

Regards,

Jagan.

Not applicable
Author

Thanks....