Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
I have an app where i want to show the number of Tickets for the current week no matter what other date filters that are used in the app.
E.g. the date filter could be set for the previous 3 months and the result is presented in a graph but I also want to present the value for the current week
How should the syntax look like?
I also tried this expression and it gives the correct result as long that you select the current week in the filter.
If ($(vDim)=(CurrentWeek),Count(wor_ticket_ID),)
TO AVOID FILTERS only the list box field is enough, in your case
Year(wor_event_start_date)&'-'& Week (wor_event_start_date) as Week , why u are using vDim in list box then?
=Count({<Week =,wor_event_start_date={">=$(=weekStart(today()))<=$(=weekEnd(today()))"}>} wor_ticket_ID)
The use of vDim is to be able to present and select Week or Month in my app. I followed this instruction when created it:
I want to avoid/exclude all filter in one single textbox, it should only present data for current week. All other graphs should use the week/month filter
Can you create another data island with ID, date?
That island will not have any connection with existing data island and you can simply have current week data, it becomes simpler than this
I created a new app with this data:
FACT_1:
LOAD
Year(wor_event_start_date)&'-'& Week (wor_event_start_date)as Week,
Year(worevent_start_date)&'-'& Month (wor_event_start_date)as Month,
(Year(Today()) &'-'& Week(Today())) as CurrentWeek,
(Year(Today()) &'-'& Month(Today())) as CurrentMonth,
wor_ticket_ID,
wor_country
FROM
However, the result is not OK. The table with 'Current week, 'Country' and 'Count(Ticket)' shows he result for all data loaded . The other table with 'Week' also shows data for all data loaded , but for the correct 'Week' (2019-9) the result is OK
You are making it complex unnecessarily.
I said just load ID and date,
LOAD wor_ticket_ID as alias1, wor_event_start_date as alias2 from table;
**NOTE : Use alias names for wor_ticket_ID and wor_event_start_date , as we are creating data island
Now in text box put this only, it will not get affected by other filter as it is different data island,
=Count({<wor_event_start_date={">=$(=weekStart(today()))<=$(=weekEnd(today()))"}>} wor_ticket_ID)
See my sample data and exp, it is giving me correct result for current week(25Feb -03Mar) ,