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: 
qlik4asif
Creator III
Creator III

Restricting bars with selection

Hi Team,

I have Bar Chart as shown below

Capture.PNG

When i select Month Oct-17 from list box chart should display

Actual---should display bars till Oct-2017(Since i am giving selection as oct-2017)

LE----should display all 12 bars(Irrespective of selections) Dont have any value so it is showing nothing in chart

Budget----should display all 12 bars(Irrespective of selections)

All bars will be having accumulated value


I am able to control budget bar by bypassing Datemonth in exprression, but not able to do for Actual


Expression-

Actual=Num(Rangesum(Above(Sum({<DateMonth ={">=$(vE2Estartdate) <=$(vE2Eenddate)"}>}Actual),0,12)),'##.###')


Please help me on this


Thanks in ADVANCE



9 Replies
OmarBenSalem

what if u alter it as folow:

=Num(Rangesum(Above(Sum({<DateMonth =,DateMonth ={">=$(vE2Estartdate) <=$(vE2Eenddate)"}>}Actual),0,12)),'##.###')


and ps: there is not need to use the num to format it; you have an entire time in where u can format ur measures like u want (easily)

qlik4asif
Creator III
Creator III
Author

Omar Thanks for reply,

But it wont take selection , if i bypass the month in expression

The problem is ,let us say when i select month oct-17,

bars are showing correct value till oct-2017 but for nov and  dec it is showing same value as oct

This is because i am doing accumulation (Check my expression)

I need Actual as 0 for Nov and Dec (Considering Oct as my selection)

Thanks

Anil_Babu_Samineni

This won't work at all due to single same filed you are degrading 2 times. That not the Qlikview behavior.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anil_Babu_Samineni

Can you define the variables you used for?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
YoussefBelloum
Champion
Champion

Hi,

if you have this on your variable:

vE2Estartdate = min(date)

change it to :


vE2Estartdate = min({1}date)

OmarBenSalem

I see, than change ur expession like thing like this:

I would be :

if(Sum({<DateMonth ={">=$(vE2Estartdate) <=$(vE2Eenddate)"}>}Actual)<>0,

Rangesum(Above(Sum({<DateMonth ={">=$(vE2Estartdate) <=$(vE2Eenddate)"}>}Actual),0,12)),null())


per analogy :


if it's like this: same as you:

RangeSum(Above(Sum({<Year={"<=$(=max(Year))"}>}[Car sales]),0,RowNo()))

result:

Capture.PNG


while as follow:


if(sum({<Year={"<=$(=max(Year))"}>}[Car sales])<>0,

RangeSum(Above(Sum({<Year={"<=$(=max(Year))"}>}[Car sales]),0,RowNo())),Null()):

Capture.PNG

qlik4asif
Creator III
Creator III
Author

vE2Eenddate

=Max({<DummyKPI={'Production Cost YTD'},PC_YTD={">0"}> + <DummyKPI={'Production Cost YTD'},PC_YTD={"<0"}>}DateMonth)

vE2Estartdate

=Date(AddMonths(vE2Eenddate,-11),'YYYY-MM')

OmarBenSalem

Didn't this do the trick? qlik4asif

qlik4asif
Creator III
Creator III
Author

No Omar,