Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Live Chat, June 29th 10AM ET. Bring your Qik Sense Enterprise, Client Managed questions! REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
sofiavaz
Creator II
Creator II

Selections in bar charts

Hi all,

I'm working with two stacked bar charts: one for absolute values, other for relative values.

The dimension is weeks for both of them (field name:AllocTransfInsDateWeek) .  When working with the app, the user may want to analyse a specific week different from the current, but for these charts, the requirement is that they keep showing the whole year.

For the first one (abs values) I've used the expression bellow, and when selecting one specif week it keeps showing the whole year.

=Count({<AllocTransfMktComm*=-{"POSTPONE UNUSUED ALOCATION"}, AllocTransfOrigMillCd={'ATF'},AllocTransfTransfStat*=-{"CANCEL"},AllocTransfInsDateYear={"$(=Year(Today()))"}, AllocTransfInsDateWeek={<=$(=vCurrentInsDateWeek)"}>}AllocTransfAllocTransfId)

However, for the relative values chart, when selecting one specif week it shows only that week. The expression I'm using is this:

=count({<AllocTransfMktComm*=-{"POSTPONE UNUSUED ALOCATION"}, AllocTransfOrigMillCd={'ATF'}, AllocTransfTransfStat*=-{"CANCEL"},AllocTransfInsDateYear={"$(=Year(Today()))"}, AllocTransfInsDateWeek={"<=$(=vCurrentInsDateWeek)"}>}AllocTransfAllocTransfId) / aggr(NODISTINCT count({<AllocTransfMktComm*=-{"POSTPONE UNUSUED ALOCATION"}, AllocTransfOrigMillCd={'ATF'},AllocTransfTransfStat*=-{"CANCEL"},AllocTransfInsDateYear={"$(=Year(Today()))"}, AllocTransfInsDateWeek={"<=$(=vCurrentInsDateWeek)"}>}AllocTransfAllocTransfId),AllocTransfInsDateWeek)

I've already tried to add a set modifier = 1 but nothing happened. Do you have any idea what I might be doing wrong or how can I solve this?

thank you very much,

Sofia

1 Solution

Accepted Solutions
sunny_talwar

Try this

=Count({<AllocTransfMktComm *= -{"POSTPONE UNUSUED ALOCATION"}, AllocTransfOrigMillCd = {'ATF'}, AllocTransfTransfStat *= -{"CANCEL"}, AllocTransfInsDateYear = {"$(=Year(Today()))"}, AllocTransfInsDateWeek = {"<=$(=vCurrentInsDateWeek)"}>} AllocTransfAllocTransfId)

/

Only({<AllocTransfMktComm*=-{"POSTPONE UNUSUED ALOCATION"}, AllocTransfOrigMillCd={'ATF'}, AllocTransfTransfStat*=-{"CANCEL"},AllocTransfInsDateYear={"$(=Year(Today()))"}, AllocTransfInsDateWeek={"<=$(=vCurrentInsDateWeek)"}>} Aggr(NODISTINCT Count({<AllocTransfMktComm*=-{"POSTPONE UNUSUED ALOCATION"}, AllocTransfOrigMillCd={'ATF'}, AllocTransfTransfStat*=-{"CANCEL"},AllocTransfInsDateYear={"$(=Year(Today()))"}, AllocTransfInsDateWeek={"<=$(=vCurrentInsDateWeek)"}>}AllocTransfAllocTransfId), AllocTransfInsDateWeek))

View solution in original post

2 Replies
sunny_talwar

Try this

=Count({<AllocTransfMktComm *= -{"POSTPONE UNUSUED ALOCATION"}, AllocTransfOrigMillCd = {'ATF'}, AllocTransfTransfStat *= -{"CANCEL"}, AllocTransfInsDateYear = {"$(=Year(Today()))"}, AllocTransfInsDateWeek = {"<=$(=vCurrentInsDateWeek)"}>} AllocTransfAllocTransfId)

/

Only({<AllocTransfMktComm*=-{"POSTPONE UNUSUED ALOCATION"}, AllocTransfOrigMillCd={'ATF'}, AllocTransfTransfStat*=-{"CANCEL"},AllocTransfInsDateYear={"$(=Year(Today()))"}, AllocTransfInsDateWeek={"<=$(=vCurrentInsDateWeek)"}>} Aggr(NODISTINCT Count({<AllocTransfMktComm*=-{"POSTPONE UNUSUED ALOCATION"}, AllocTransfOrigMillCd={'ATF'}, AllocTransfTransfStat*=-{"CANCEL"},AllocTransfInsDateYear={"$(=Year(Today()))"}, AllocTransfInsDateWeek={"<=$(=vCurrentInsDateWeek)"}>}AllocTransfAllocTransfId), AllocTransfInsDateWeek))

View solution in original post

sofiavaz
Creator II
Creator II
Author

Thank you Sunny, it works!