Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
ericarru
Contributor

Sow Gaps on Time Field

Hello Everyone,

I have some data about events that happen in several days. In my chart, in order to show graphically if they are close to each order I want show the days with 0 as value. To do it, I need to have at least the register of the dais without events. The point is that if I select one EventCode that is not in all the days, those days disappear.  For this i fond 2 solutions:

     1 - Use the "show all values" on the Day dimension.

     2 - Use a hidden expression with that omits the EventCode Field like, sum({<Event=>} 1)

But i can not use any of this two options for the following reasons:

     1.1 - I have a whole Year of data, using this solution find the days with events starts to be complicated (obviously using the scroll bar)

     2.2 - The hidden expression works fine but if you have EventCode as a secondary dimension (to know which of the selected events is happening)  all the different events appear on the legend. Given that on my QV exists like 50 different events, the user needs to see only the selected ones.

Here is a QV and Dummy data to test my problem.

  

Data:

LOAD *

Inline [

Day,EventCode

1,1

1,1

1,2

2,2

8,1

10,2

];

Concatenate(Data)

LOAD *

Inline [ Day

3

4

6

7

9

11

12

13

14

15

16

];

Is there any other way that let me select the EventCode without having to see all the days and or having to see all the EventCodes on the legend?

Pictures of What I see electing EventCode 2 and Days from 1 to 11:

0: If I don't do anything:

GapsOnDays_0.png

1: Solution1

GapsOnDays_1.png


2: Solution2


GapsOnDays_2.png



I also add a QV with this data.



7 Replies

Re: Sow Gaps on Time Field

Based on your input data, can you provide example if any event code is selected what representation do you want?

ericarru
Contributor

Re: Sow Gaps on Time Field

I have modified the starting post I think this way will be more clear for anyone who reads the post.

effinty2112
Honored Contributor

Re: Sow Gaps on Time Field

Hi Eric,

I changed your script so the two tables were not concatenated to get this data model that, to me, makes more sense.

2.png

I can make this chart:

1.png

There are two expressions in the chart. The second one is just 1, that's all. Check the Invisible checkbox and choose style Stacked.

Hope this helps.

Andrew

MVP
MVP

Re: Sow Gaps on Time Field

Maybe like attached?

ericarru
Contributor

Re: Sow Gaps on Time Field

I think it's good and with this dummy data no problem but when you have the days in format like "2017/10/04" the day is converted to "43005" (which is the numeric form of the Day). This also forbids you to use the scrollbar and if you want to go back in time with the same zoom you have to go by selecting and unselecting days which is not much comfortable to use when they are in number form Smiley Frustrated.

ericarru
Contributor

Re: Sow Gaps on Time Field

I can not get to your solution. I am with the two tables and also with this number 1 without expression and set analysisInvisible.png

Invisible2.png

asvalcuende
New Contributor II

Re: Sow Gaps on Time Field

I have the same problem, please help!

Community Browser