Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
simsondevadoss
Partner - Creator III
Partner - Creator III

Selection

Hi all,

As per my requirement whenever i select a month , the bar should be available for only the month selected and the value should remain constant.

I have used rangesum in my expression ( we can also use full accumulation ).

Please find the attached sample application .

For example : if i select month of may , value should be 2620 with single bar.

Thanks in advance

1 Solution

Accepted Solutions
Not applicable

For zero intervention on the script you have this approach (attached) using alternate states.

I hope you find this helpful.

Kind regards,

Nuno

View solution in original post

7 Replies
Not applicable

Hi,

You could do it on the script like this and then use sum(value) as expression:

LOAD month,rangesum(peek(value),value_tmp) as value;

LOAD month,  

    count(SR_ID) as value_tmp

Resident MasterData

Group by month

Order by month;

Hope this helps.

Kind regards,

Nuno

MK_QSL
MVP
MVP

Your data having ASSIGNED DATEs from January 2012, so when you group them by month i.e. Jan... the SR_ID count for Jan is actually for 2012, 2013 and 2014 which could be (may be) wrong..

Apologize if you are intended to show by the same way you have shown in bar chart...

If not, you need to create MonthYear or YearMonth field instead of only Month field...

You can create the same as below

Date(MonthStart(FLOOR(TimeStamp(ASSIGNED_DATE))),'YYYYMM') as YearMonth

Now you can use this field to create the desired result....

if 201405 selected, you should get date from 201401 to 201405 in a single bar...

simsondevadoss
Partner - Creator III
Partner - Creator III
Author

Thanks for the response.

Is it possible to get it in the front end itself ? instead of aggregating in the back end.

Regards,

Simson

MK_QSL
MVP
MVP

Obviously.... !

You need to create YearMonth in backend and use the dimension in front end to achieve the result...

Not applicable

For zero intervention on the script you have this approach (attached) using alternate states.

I hope you find this helpful.

Kind regards,

Nuno

simsondevadoss
Partner - Creator III
Partner - Creator III
Author

Thanks Nuno.

But what if user selects more than one month ?

Regards,

Simson

Not applicable

Hi,

currently if the user selects more than one value it will show all moths.This doesn't work on more than one selection (for that you need the script approach).

My suggestion is that you use

=getselectedcount(month)<2

as the calculation condition and in the error message for calculation condition unfulfilled put something like:

'Please select only one month'

Kind regards,

Nuno