Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi qlikers
i want to use between function in qlik and my expresion as shown below :
sum(if(Floor(CreatedDate) = MakeDate(year(Today()),Month(Today())-1) and MakeDate(year(Today()),Month(Today())),1,0))
Hi
1)which measure are going to sum ?(sales , patents ?
2)Are you looking for sum between current month and previous month ?
Give some more details
Use variables in the qlik and use them in your SET expression to calculated the dates between
Ex:-
Let vFrDate =MakeDate(year(Today()),Month(Today())-1);
Let vToDate =MakeDate(year(Today()),Month(Today()));
Then use SUM expression to SUM your metric fields but need to check other field selections as well
=Sum({<DateField={">=$(=vFrDate) <=$(=vToDate)"} >} Value)
Hi,
Try this,
In script make date field format like date(createdate,'DD-MM-YYYY') as createdate
in Expr:
sum(if(createdate>=date(addyears(today(),-1)),'DD-MM-YYYY') and createdate()<=date(today(),'DD-MM-YYYY'),1,0))
Regards,
If you are using this in the load script then try this ways
Load
...
..
Sum(if( CreatedDate >= MakeDate(year(Today()),Month(Today())-1) and
CreatedDate <= MakeDate(year(Today()),Month(Today())),1,0))
From Source
...
...;
i want to sum created for previous month and i am writing that code in expression as below :
sum(if(Floor(CreatedDate)>= MakeDate(year(Today()),Month(Today())-1) and Floor(CreatedDate)< MakeDate(year(Today()),Month(Today())),1,0))
actually it works but does not return the accurate number
note i am not trying to build it in script .