Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have date dimension and i want to calculate current sales & previous sales from one date to another date.
In that case, how can i write the exact expression for that???
-[Process Date Time] is my date dimension.
if ([Process Date Time] between ?Start? and ? End?) then ([Item Gross Price]) else (0)---this is my Sql Query, so how can i implement this into Qlik.
Try this
with variable
if(
[Process Date Time] >$(vMinDate) and [Process Date Time] <$(vMaxDate) ,
sum( [Item Gross Price])) , 0)
without variable
if(
[Process Date Time] >'2012-02-02' and [Process Date Time] <'2012-02-28' ,
sum( [Item Gross Price])) , 0)
Hi,
you can try with set analysis for best performance:
Create two variables:
vStart= start date
vEnd= end date
Sum({<[Process Date Time]= {">=$(=vStart)<=$(=vEnd)"}>} [Item Gross Price])
I don't have separate start date and end date column, i have only only date range column(Procees date time)'
In that case how can i create variable ??
I don't have separate start date and end date column, i have only only date range column(Procees date time)'
In that case how can i create variable ??
VMINDATE=MIN(DATE(PRROCESS DATE TIME),'DD/MM/YYYY'))
VMAXDATE=MAX(DATE(PRROCESS DATE TIME),'DD/MM/YYYY'))
You can User an input field to set your Min and Max variables.
Create like this
vMinDate =MIN(DATE(PRROCESS DATE TIME),'DD/MM/YYYY'))
vMaxDate =MAX(DATE(PRROCESS DATE TIME),'DD/MM/YYYY'))
and use it