Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dimension to show only one week of data

Hello All,

I'm brand new to qlikview and coding in general. I'm trying to figure out how to have a bar chart that shows only one week of data.

Currently I'm using 'WRK_APP_SOURCE' as the current dimension to display whether the source is apple or windows (a grouped chart)

I have 3 expressions which are: 'Compliant', 'Non-Compliant', and 'Total' so there are 3 bars per source = six bars in total grouped by Apple and Windows.

I have another field in my data called 'Login_Date'. I want to be able to restrict the chart by the log in date being within the last 7 days. How would I do that?

Thanks in advance.

1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

Did you try the expression i sent in my previous document i attached. ? This one

= Count({< WRK_STATUS = {3} >} IF(LoginDate >= Date(Today()-6 , 'MM/DD/YYYY') AND LoginDate <= Date(Today(), 'MM/DD/YYYY'), WRK_STATUS))

View solution in original post

8 Replies
Anonymous
Not applicable
Author

=Sum({<Login_Date = {">=$(=Date(Today()-6,'MM/DD/YYYY'))<=$(=Date(Today(),'MM/DD/YYYY'))"}}  Compliant)




=Sum({<Login_Date = {">=$(=Date(Today()-6,'MM/DD/YYYY'))<=$(=Date(Today(),'MM/DD/YYYY'))"}} Non-Compliant



=Sum({<Login_Date = {">=$(=Date(Today()-6,'MM/DD/YYYY'))<=$(=Date(Today(),'MM/DD/YYYY'))"}}  Total)


……………………………….

Not applicable
Author

hm, this would work, but for my current expressions there are already calculations:

For example-

Compliant:

COUNT( IF(WRK_STATUS = 3,WRK_STATUS))

how would I combine the two? thanks.

vishsaggi
Champion III
Champion III

In Allu's script replace Complaint with your calculated expression. Like.May be try this?

=Sum({<Login_Date = {">=$(=Date(Today()-6,'MM/DD/YYYY'))<=$(=Date(Today(),'MM/DD/YYYY'))"}} COUNT( IF(WRK_STATUS = 3,WRK_STATUS)))

Not applicable
Author

Doing this removes the entire bar

vishsaggi
Champion III
Champion III

Can you try this?

= Count({<Login_Date = {">=$(=Date(Today()-6,'MM/DD/YYYY')) <=$ (=Date(Today(),'MM/DD/YYYY'))"} >}  IF(WRK_STATUS = 3,WRK_STATUS))

Not applicable
Author

pls have a look on this

Not applicable
Author

Thank you. When I add this line to the script and then change the expression it still shows blank.

LOAD *,

     Date(Num(Floor(WRK_SCCM_APP_LOGIN_DATE)), 'MM/DD/YYYY') AS LoginDate;

vishsaggi
Champion III
Champion III

Did you try the expression i sent in my previous document i attached. ? This one

= Count({< WRK_STATUS = {3} >} IF(LoginDate >= Date(Today()-6 , 'MM/DD/YYYY') AND LoginDate <= Date(Today(), 'MM/DD/YYYY'), WRK_STATUS))