Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I need to show the takings value of this week and last year same week data in a Qliksense app.Can anyone please help me in this?
Hi, try to use simple WHERE clause when loading your table:
LOAD *
FROM [YourTable]
WHERE week(YourDateField)=week(Today()) and (Year(YourDateField)=Year(Today()) or Year(YourDateField)=Year(Today())-1);
@Jarvis There are plenty of ways to get this done. You can create four Variables in the Load script something like below:
VCurrentYearWeekstart: Date(Weekstart(Addyears(today(),0)),'MM/DD/YYYY')
VCurrentYearWeekend: Date(Weekend(Addyears(today(),0)),'MM/DD/YYYY')
VPrevYearWeekstart:Date(Weekstart(Addyears(today(),-1)),'MM/DD/YYYY')
VPrevYearWeekend:Date(Weekend(Addyears(today(),-1)),'MM/DD/YYYY')
Now in the Load
Temp:
Load *
from Table_Name
where (Date_field>='$(VCurrentYearWeekstart)' and Date_field<='$(VCurrentYearWeekend)' )
or(Date_field>='$(VPrevYearWeekstart)' and Date_field<='$(VPrevYearWeekend)' )
Or you can follow what @justISO mentioned as well.